Jun 5, 2011

MYSQL: Error 1062 - Duplicate key

Slave Replicate SLAVE_SKIP_COUNTER


In some reason this mostly happened when your slave server already out of synchronization to the master server.

The exercise, we need to skip that error Duplicate key and can be done by adding the line in the mysql config my.cnf



slave-skip-errors = 1062


If you encounter this kind of error. Just easy, you need only to skip the counter by by 1 until you fix it.



mysql> SLAVE STOP;
mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
mysql> START SLAVE;

No comments: