mysql 5.7 基于GTID 主从同步的1236故障处理(其它事务故障等同)

登录从库

stop slave;

查看执行事务

show slave statusG

Retrieved_Gtid_Set: ee3bdb44-f6a1-11e7-b194-005056a35fd4:21315405-51853406
Executed_Gtid_Set: ee3bdb44-f6a1-11e7-b194-005056a35fd4:1-51853406

注:Retrieved_Gtid_Set 为获取主库上的事务ID

Executed_Gtid_set为正在执行的事务ID

reset master;

 SET @@GLOBAL.GTID_PURGED =' ee3bdb44-f6a1-11e7-b194-005056a35fd4:51853406'

start slave;

show slave statusG,查看同步是否正常

如果错误很多。建议重新作从库。

原文地址:https://www.cnblogs.com/net2817/p/9340786.html