简体   繁体   English

Mysql复制数据库无法正确更新

[英]Mysql Replicated database not updating properly

I have been trying to start replication in a mysql database. 我一直在尝试在mysql数据库中启动复制。 I followed all the steps from the mysql manual to setup and configure the replication. 我按照mysql手册中的所有步骤进行设置和配置复制。

http://dev.mysql.com/doc/refman/5.1/en/replication-howto.html http://dev.mysql.com/doc/refman/5.1/en/replication-howto.html

I could start the replication without any trouble. 我可以开始复制而不会遇到任何麻烦。 Newly inserted data was replicated properly. 新插入的数据已正确复制。 But after a while I observed that though INSERT are working, the UPDATEs are not replicating. 但是过了一会儿,我发现尽管INSERT可以正常工作,但UPDATE没有复制。 So, my replicated database contains data just as it was inserted first time. 因此,我的复制数据库包含的数据与第一次插入时一样。

My master database is on an UNIX server with MYSQL-5.1.56. 我的主数据库位于具有MYSQL-5.1.56的UNIX服务器上。 The slave is used in Windows using WAMP package with MYSQL 5.5.8. 在Windows中,使用带有WAMP软件包和MYSQL 5.5.8的从属服务器。 I have also tried a slave with lower version mysql with WAMP5, with same effect. 我也尝试过使用WAMP5与较低版本的mysql进行从属,效果相同。

Please share your ideas and experience on this. 请分享您的想法和经验。 Thanks. 谢谢。

I have similar problem. 我有类似的问题。 I know it's old thread but it can help others: 我知道这是旧线程,但可以帮助其他人:

link: mysql replication works only if I choose database by USE database 链接: 仅当我通过USE数据库选择数据库时,mysql复制才有效

I sorted it out a few months ago. 几个月前我整理了一下。 The problem was, I tried to replicate only one single database, and set binlog_do_db and binlog-ignore-db options in master to select only that database. 问题是,我尝试仅复制一个数据库,并在master中将binlog_do_dbbinlog-ignore-db选项设置为仅选择该数据库。 But that left out any statement which was executed without selecting database by USE database, as kayn said. 但是,正如kayn所说的那样,这遗漏了在不按USE数据库选择数据库的情况下执行的任何语句。 Using replicate-ignore-db and replicate-do-db options in slave would do the same. 在slave中使用replicate-ignore-dbreplicate-do-db选项会做同样的事情。 So I finally fixed it by using the replicate-wild-do-table option in the slave, referenced here . 因此,我最终通过在从属设备( 在此引用)中使用replicate-wild-do-table选项修复了它。 Added the following line in the configuration of the slave server. 在从属服务器的配置中添加了以下行。

replicate-wild-do-table=mydb.%

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM