【Mysql】Last_SQL_Error: 1594

未开启gtid模式

可用以下方式跳过错误:
异常断电和关机除了可能导致主键重复的错误之外,还可能导致中继日志损坏

针对这个问题,首先,找到master binlog执行的位置

位置

然后重新连接Master服务器,(需要先停止slave)

最后查看复制情况,已经正常。


若开启了gitd模式

  1. 可以使用change master来修复。
  2. > stop slave;
  3. Query OK, 0 rows affected (0.02 sec)

  4. 如果以前修复可以手工对应下标和日志来指定修复,但是在gtid的场景里,还是不需要这样了。
  5. > change master to Master_Log_File='mysql-bin.000226', Master_Log_Pos=884805205;
  6. ERROR 1776 (HY000): Parameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is active.

  1. > change master to master_host='10.127.0.xxx',master_port =3306,master_user='repl',master_password='xxxx',master_auto_position=1;
  2. Query OK, 0 rows affected, 2 warnings (0.51 sec)
  3. 然后再次查看发现就开始缩小了日志差距,大概等了十几分钟之后,就追平了日志gap.




参考
http://linux-tips.org/t/mysql-replication-error-1594/248
http://blog.itpub.net/29096438/viewspace-1826758/
http://blog.itpub.net/23718752/viewspace-2055909/
请使用浏览器的分享功能分享到微信等