1.检查从库
show slave status \G;
Slave_IO_Running: Yes
Slave_SQL_Running: No
2.出现类似如下的报错:
Last_SQL_Error: Error ‘Duplicate entry ‘1001-164761-0‘ for key ‘PRIMARY‘‘ on query. Default database: ‘bug‘. Query: ‘insert into misdata (uid,mid,pid,state,mtime) values (164761,1001,0,-1,1262623560)‘
3.解决方案:
在丛库上,执行以下命令,跳过它:
set global sql_slave_skip_counter = 1
说明:执行一次后查看是否正常,不正常再继续执行该命令