Replicate a single table

瘦欲@ 提交于 2019-12-03 09:57:06

Yes this is possible. Have a look at the slave options of the MySQL manual. This still requires to create a complete binlog of the whole database though.

To sync specific tables again to one or more slaves rather use pt-table-checksum and then pt-table-sync

That should automatically identify the out-of-sync tables and only sync those.

Scarecrow

I know this is an old question but this is for anyone who comes here looking for an answer:

CREATE TABLE table2 LIKE table1;

This will create a table with the same format and columns but no data. To transfer the data use:

INSERT INTO table2 SELECT * FROM table1;

EDIT:

It is important to note that this is an information transfer only. Meaning if you had indexes on table1 they are not transferred to table2. You will have to manually index table2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!