MySQL Forums
Forum List  »  Replication

Re: Error Duplicate entry - Master-Slave replication
Posted by: Rick James
Date: January 11, 2012 10:16AM

Another way in which replication can be unwittingly screwed up by a user:

binlog-do-db = db1
USE db2;
INSERT INTO db1.tbl ...

When using binlog/replicate-do/ignore (other than ...wild...), the USE statement controls whether the subsequent writes are replicated. The example above show how a statement would _not_ be replicated when it should be. (Hmmm... I guess that won't lead to dup key.)

Sounds like you need to rebuild the slave, then keep a close eye on everything happening to the table in question.

I have not seen any caused by MySQL since mid-versions of 4.0. Every error I have encountered has been traced to "user error".

Some ways to screw things up, but probably knowingly:
Do you have Triggers?
Have you ever used SET SQL_BIN_LOG=0?
Which are you using: RBR or SBR or a mixture? (Row/Statement Based Replication)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Error Duplicate entry - Master-Slave replication
4678
January 11, 2012 10:16AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.