Mysql replication on single server

♀尐吖头ヾ 提交于 2019-12-13 05:19:06

问题


Is it possible to set up replication on a single mysql server, replicating a few tables (for readonly access) from one database to another?

So say my server has 2 databases - DB1 and DB2. DB1 has tables tableA, tableB, and tableC. DB2 has tables tableD, tableE, and tableF. From DB2, I'd like to have access to data in tableA without doing a cross-database query because the databases will eventually reside on separate mysql servers on separate machines.


回答1:


Try this ...

http://dev.mysql.com/doc/refman/5.5/en/replication-options-slave.html#option_mysqld_replicate-wild-do-table




回答2:


Sure, you can do replication on a single MySQL server. But I think you may like to have a look at the FEDERATED storage engine - http://dev.mysql.com/doc/refman/5.0/en/federated-storage-engine.html.

A word of caution though that FEDERATED tables have their own limitations and I think they do not perform very well with very busy tables. So, you'll need to burn some hours to research on federated tables and see if they work for your setup.



来源:https://stackoverflow.com/questions/6375320/mysql-replication-on-single-server

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