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
- 4612 reads

Yes, that's very useful for
Yes, that's very useful for a lot of things. Thanks.
ขอบคุณครั
ขอบคุณครับ จะลองไปทำดู
Great Solution!
We implemented a master/slave MySQL solution a few months ago for our site at http://www.blogpatrol.com and encountered the "duplicate entry error" for the first time today.
After cleaning up our database, we implemented your solution to prevent the error in the future. We've credited your solution on our blog at http://thepatrolblog.blogspot.com/2007/07/database-down.html
Thanks for sharing this tip!
Great tip, cheers.
Great tip, cheers.
Site has errors
Your site is getting mysql errors. Plus, there is no email contact readily available for me to send this message to, so I had to put up a posting in hope that someone would come and fix this site. No Contact Us information is a usability issue that should be corrected also.
it's work fine in your
it's work fine in your opinion
skip errors?
you said that when you put that small piece of configuration the mysql config file... it will skip the error but it might lead the replication to stop. so it means that the slave will not function anymore? or it will just skip the specific row where the error occurs
情趣用品,情趣用品,情
情趣用品,情趣用品,情趣用品,情趣用品,情趣用品,情趣,情趣,情趣,情趣,情人歡愉用品,情惑用品性哥,情人用品性哥,情趣用品,AIO交友愛情館,情人歡愉用品,美女視訊,情色交友,情人用品性哥,視訊交友,辣妹視訊,美女交友,性愛,嘟嘟成人網,按摩棒,震動按摩棒,微調按摩棒,情趣按摩棒,逼真按摩棒,G點,跳蛋,跳蛋,跳蛋,性感內衣,飛機杯,充氣娃娃,情趣娃娃,角色扮演,性感睡衣,後庭區,SM,潤滑液,情趣禮物,威而柔,香水,精油,芳香精油,自慰,自慰套,性感吊帶襪,情趣用品加盟,情人節禮物,情人節,吊帶襪,辣妹視訊,美女交友,情色交友,成人交友,視訊聊天室,美女視訊,視訊美女,情色視訊,免費視訊聊天,視訊交友,視訊聊天,AIO交友愛情館,嘟嘟成人網,成人貼圖,成人網站,AIO交友愛情館,情色,情色貼圖,情色文學,情色交友,色情聊天室,色情小說,七夕情人節,色情,A片,A片下載,免費A片,免費A片下載,情色視訊,情色電影,色情網站,辣妹視訊,視訊聊天室,情色視訊,免費視訊聊天,視訊聊天,美女視訊,視訊美女,美女交友,美女,情色交友,成人交友,自拍,本土自拍,情人視訊網,視訊交友90739,生日禮物,情色論壇,正妹牆,正妹,成人網站,A片,免費A片,A片下載,免費A片下載,AV女優,成人影片,色情A片,成人論壇,情趣,免費成人影片,成人電影,成人影城,愛情公寓,色情影片,保險套,舊情人,微風成人,成人,成人遊戲,成人光碟,色情遊戲,跳蛋,按摩棒,一夜情,男同志聊天室,肛交,口交,性交,援交tdyrf
Post new comment