首页 > 精选文章 > 数据库开发 > 正文

mysql slave 重新同步单个表的过程

mysql> RENAME TABLE rep TO rep_maint;
Query OK, 0 rows affected (0.01 sec)
 
mysql> SELECT * FROM rep_maint INTO OUTFILE '/tmp/rep.txt';
Query OK, 0 rows affected (0.01 sec)
 
mysql> CREATE TABLE rep_new LIKE rep_maint;
Query OK, 0 rows affected (0.00 sec)
 
mysql> LOAD DATA INFILE '/tmp/rep.txt' INTO TABLE rep_new;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Deleted: 0  Skipped: 0  Warnings: 0
 
mysql> RENAME TABLE rep_maint TO rep_old, rep_new TO rep;
Query OK, 0 rows affected (0.00 sec)
  • 上一篇:HTTP参数中Etag的重要性
  • 下一篇:多主一从mysql replication同步表的大胆尝
  • 了解这些字:重的意思 新的意思 同的意思 步的意思 单的意思 个的意思 表的意思 的的意思