mysql从传统模式切到GTID模式后启动主从,主从异常报错1236
GTID主从异常报错1236
ast_IO_Errno: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires. Replicate the missing transactions from elsewhere, or provision a new slave from backup. Consider increasing the master's binary log expiration period. The GTID set sent by the slave is '', and the missing transactions are '6c15ecda-03f3-11ec-987e-6c92bff6906b:1-5,
a75b06d9-03ec-11ec-9ca3-6c92bff6a8fb:1-6'.'

1.解决办法(从节点从来没有过gtid 值的时候)
在主节点执行:
show variables like '%gtid_purged%';
+---------------+------------------------------------------------------------------------------------+
| Variable_name | Value |
+---------------+------------------------------------------------------------------------------------+
| gtid_purged | 6c15ecda-03f3-11ec-987e-6c92bff6906b:1-5,
a75b06d9-03ec-11ec-9ca3-6c92bff6a8fb:1-6 |
+---------------+------------------------------------------------------------------------------------+
然后再在从节点设置gtid_purged为主节点gtid_purged值。
stop slave;
set global gtid_purged="6c15ecda-03f3-11ec-987e-6c92bff6906b:1-5,
a75b06d9-03ec-11ec-9ca3-6c92bff6a8fb:1-6";
start slave;
show slave status\G
2.解决办法,(有值的话需要加上从节点的已经执行过的gtid即gtid_executed)
参考文档:https://blog.csdn.net/weixin_42360467/article/details/113128267
本文来自博客园,作者:whiteY,转载请注明原文链接:https://www.cnblogs.com/whiteY/p/17331882.html

浙公网安备 33010602011771号