Repair mysql replication

When mysql server is having problem replicating data on the slave, the slave stops running.

mysql> show slave status \g
Slave_SQL_Running: No
Last_Error: Error ‘Table ‘dbx.test’ doesn’t exist’ on query. Default database: ‘dbx’.

To fix the error, we just ignore the error and resume the replication by doing the following steps:

1. Stop slave: mysql> STOP SLAVE;

2. Ignore error: mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;

3. Resume: mysql> slave start;

At this point mysql> show slave status \G  will return “Slave_SQL_Running: Yes”

No Comments yet »

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress with GimpStyle Theme design by Horacio Bella.
Entries and comments feeds. Valid XHTML and CSS.