MySQL Replication ERROR 1062: Duplicate Entry for Primary Key when starting Slave

On Salve

MySQL Replication ERROR 1062: Duplicate Entry for Primary Key when starting Slave6 min read

Tagged:

Answers

  • In Linux: vim /etc/my.cnf
    In Windows: C:\Program Files\MySQL\MySQL Server 5.1\my.ini

    [mysqld]
    
    slave-skip-errors=1062
    skip-slave-start
    

    Save and quit the file by restart the service by using the following command
    In Linux:
    sudo service mysqld restart

    In Windows:
    Go To Task manager > services > MySQL
    Right Click and Stop service then Start Service

    After This Step, Login to MySQL Command Line and Restart SLAVE by following command:

    STOP SLAVE;
    START SLAVE;
    SHOW SLAVE STATUS \G
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!