MySQL master-slave: primary key conflict issues

Source: Internet
Author: User

1. Check from library

show slave status \g;

Slave_io_running:yes
Slave_sql_running:no

2. An error similar to the following appears:

Last_sql_error:error ' Duplicate entry ' 1001-164761-0 ' for key ' PRIMARY ' on query. Default database: ' Bugs '. Query: ' INSERT into Misdata (uid,mid,pid,state,mtime) VALUES (164761,1001,0,-1,1262623560) '

3. Solution:

On the Plex library, execute the following command to skip it:

re-start slave:start slave; Description: After the execution of the check is normal, not normal and then continue to execute the command

Or add this in the MY.CNF from the library:
Slave-skip-errors = 1062

MySQL master-slave: primary key conflict issues

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.