开发者

Replication master-slave in MySQL having more tables on the slave

开发者 https://www.devze.com 2023-04-09 04:06 出处:网络
Question to database specialists: is it possible to make replication master-slave in MySQL having more tables on the slave? I know only about different table definitions

Question to database specialists: is it possible to make replication master-slave in MySQL having more tables on the slave? I know only about different table definitions http://dev.mysql.com/doc/refman/5.1/en/replication-fe开发者_高级运维atures-differing-tables.html


You can have tables on the slave that do not exist on the master and replication will proceed normally for those tables that exist on both master and slave (assuming you have not excluded them from replication of course!).

If you want tables on the slave that do not exist on the master you will have to create them directly on the slave database.

For example:

Master has tables a, b, c

Slave has tables a, b, c.

Replication is set up to replicate changes from a, b and c on the master to the slave.

Create table d on the slave (so slave now has tables a, b, c and d).

Replication should continue for tables a, b and c with table d on the slave unaffected.

In this situation table d would exist only on the slave.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号