MySql - 两个从数据库复制
我想实现同一服务器复制,这样就会有两个数据库在同一服务器上复制一个数据库
这是我在 my.ini 中的配置,
enter code here
server-id=1
log-bin
report-host=master-is-slave-host
log-bin=localhost-binlog
relay-log=localhost-relaylog
replicate-same-server-id=1
binlog-do-db=test
replicate-rewrite-db=test->myslave
**#replicate-rewrite-db=test->myslave2 does not work**
replicate-do-table=myslave.tblslave
**#replicate-do-table=myslave2.tblslave does not work**
上面的代码可以很好地从同一服务器上的 db test 复制到 myslave
我也想实现从 db test 复制到同一服务器上的 myslave2 以及 myslave
基本上它将是一个主数据库和两个从数据库复制同一主数据库
问候, 里兹万
I want to achieve same server replication, such a way there will be two databases replicating one database on same server
Here is my configuration in my.ini
enter code here
server-id=1
log-bin
report-host=master-is-slave-host
log-bin=localhost-binlog
relay-log=localhost-relaylog
replicate-same-server-id=1
binlog-do-db=test
replicate-rewrite-db=test->myslave
**#replicate-rewrite-db=test->myslave2 does not work**
replicate-do-table=myslave.tblslave
**#replicate-do-table=myslave2.tblslave does not work**
the above code works fine for replication from db test to myslave on same server
I also want to achieve replication from db test to myslave2 on same server along with myslave
Basically it will be one master db and two slave db replicating the same master db
Regards,
Rizwan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我的 my.cnf 代码:
Here is my code from my.cnf: