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 r...
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)
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)
- 转载请注明来源:IT学习网 网址:http://www.t086.com/ 向您的朋友推荐此文章
- 特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系我们,我们会尽快予以更正。