描述:
主库MySQL5.6
从库1:MySQL5.1 (new)
从库2:MySQL5.6
新搭建的MySQL 5.1 和5.6 在同一实例上,从库2slave正常,从库1 报错如下:
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.000003'
操作:
根据报错信息检查主库的binlog日志相关设置
mysql> show global variables like '%check%';
+---------------------------+--------+
| Variable_name | Value |
+---------------------------+--------+
| binlog_checksum | CRC32 |
| foreign_key_checks | ON |
从库5.1版本中没有该参数,5.6 版本(从库2)和主库的配置一致,MySQL 版本5.6.23
原因:
在MySQL5.6.2 之后新增的该参数,5.6.6之后默认值是CRC32,会在binlog 中添加checksum 的信息,用来校验MySQLbinlog日志。
配置成none ,在binlog中只记录event的完整信息和event 的长度,不会添加checksum数据。
在向后兼容的架构中,考虑到binlog 记录内容的变化,需要显式的将参数设置成none
对比:
不同设置binlog的变化:
binlog_format=crc32
#190621 14:50:51 server id 1642493817 end_log_pos 350 CRC32 0x1731bbf2 Query thread_id=10 exec_time=0 error_code=0
use `test`/*!*/;
SET TIMESTAMP=1561099851/*!*/;
insert into wsltest00(vol1) values('yes yes')
/*!*/;
binlog_format=none
#190621 15:01:56 server id 1642493817 end_log_pos 336 Query thread_id=11 exec_time=0 error_code=0
use `test`/*!*/;
SET TIMESTAMP=1561100516/*!*/;
insert into wsltest00(vol1) values('no no')
/*!*/;