略微加速

略速 - 互联网笔记

mysql同步复制报Slave can not handle replication events with the checksum that master错误

2020-04-30 leiting (1461阅读)

标签 MySql

做主主同步时,基本信息:

1.master1 mysql版本是5.6

2.master2 mysql版本时5.5


一:在master1做slave,master2做主数据库时成功。

二:在master1做master,master2做从数据库时报错


Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the first event 'mysql-bin.000001' at 5115510, the last event read from './mysql-bin.000001' at 5115510, the last byte read from './mysql-bin.000001' at 120.'


查询资料发现mysql版本为5.6时,这个错误一般出现在master5.6,slave在低版本的情况下。这是由于5.6使用了crc32做binlog的checksum;

当一个event被写入binary log(二进制日志)的时候,checksum也同时写入binary log,然后在event通过网络传输到从服务器(slave)之后,再在从服务器中对其进行验证并写入从服务器的relay log.

由于每一步都记录了event和checksum,所以我们可以很快地找出问题所在。


在master1中设置 binlog_checksum=none


重启mysql


重新查询master状态,show master status\G;


记录下来。


从服务器重新进行连接:


change master to master_host='192.168.15.201',master_user='repl',master_password='epimap.123456',master_log_file='mysql-bin.000012',master_log_pos=211;


即可解决5.5/5.6主主同步问题。


原文链接:https://blog.csdn.net/wantingtingting/article/details/41944047


北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3