How to prevent duplicate entry error in MySQL
Sometimes, errors should be ignored because they are not necessary at all. In MySQL especially for replication, the general architecture is to have a host for write and other hosts for read. As a result, response time of the whole system should be more scalable. If something goes wrong at the master node where all write operations must be performed, the error may propagate to other replications. One of common error oftenly occurs during replication is duplicate entry. It is possible to prevent this error which may lead the replication to stop.
This problem was reported for so long and it it supposed to be fixed already. However, I still got them sometimes. The solution is to specify slave-skip-erros
at client side as follows.
[mysqld]
slave-skip-errors = 1062
1062
means to duplicate entry error. For more information, read below links.
Tags: mysql, replication
- sugree's blog
- 17064 reads
Yes, that's very useful for
ขอบคุณครั
Great Solution!
Great tip, cheers.
Site has errors
it's work fine in your
skip errors?
Post new comment