备份恢复
1.从库查询状态
slave status
Master_Log_File: mysql-bin.000120
Slave_IO_Running: Yes
Slave_SQL_Running: No
RELAY_Master_Log_FILE: mysql-bin.000119
Exec_Master_Log_Pos: 87663322
Last_Error: xxxxx
这种状态就是要从mysql-bin.000119 的87663322 行开始恢复,只能一点点比对了。
2.主库查询binlog
show binlog events in 'mysql-bin.000119' from 87663322 limits 100000;
然后看卡在哪个事务上了。
3.从库跳过错误的事务
stop slave;
set GLOBAL SLAVE_SLAVE_SKIP_COUNTER = 1;
start slave;
然后回到步骤1 继续找。如果每个事务都不长,可以调整SLAVE_SLAVE_SKIP_COUNTER的值一次跳过多个事务。