Linux – Setup MySQL replication of specific tables of a database to another thesql server

linuxMySQLreplication

I have several production MySQL databases running on an RHCS cluster. I want to setup replication of one specific database, with only specific tables from that database, to another brand new mysql database server. Can this be done, if so, how?

Best Answer

With Mysql Community server (common version), it is possible to setup replication of databases.

It could be set as master-slave or master-master. The best guide I've seen for those are Master-Slave replication howto and Master-Master replication howto.

The option chosen mainly depends on whether you need your second server to be able to do updates to the DB. A master-master replication requires a bit more effort to implement and to troubleshoot, but is as stable.

Note that this does not allow to select tables, just the database. Doing that would require custom replication (outside the database engine) which would be slower and less reliable than the built-in option.

Related Topic