8

MySQL 搭建主从同步,从报 Slave can not handle replication events with the checks...

 3 years ago
source link: https://www.liurongxing.com/mysql-slave-can-not-handle-replication-events-with-the-checksum-that-master.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

MySQL 搭建主从同步,从报 Slave can not handle replication events with the checksum that master 错误问题

作者: JavasBoy 分类: MySQL 发布时间: 2015-07-20 20:01 ė 112,923 views 6 2条评论

心血来朝,想复习一下MySQL主从搭建,虽开打VM,分别开启了我以前安装的两台虚拟机,一台CentOS6 一台Ubuntu,这两台都安装好了MySQL数据库,安装啥的不说了,配置也没问题。但是但我把主上的数据库dump出来,复制来从上,然后做同步的时候报错了:

Slave_IO_Running: No
Slave_SQL_Running: Yes
Last_IO_Error: 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 'binlog.000005' at 805, the last event read from '/data/dbdata/mysqllog/binlog/binlog.000005' at 805, the last byte read from '/data/dbdata/mysqllog/binlog/binlog.000005' at 120.'

百思不得奇解,还叫过DBA把我从做了一遍,还是报这个错,虽放 Google 一搜索,好家伙。

这是由于 master 用的 mysql5.6 , binlog_checksum 默认设置的是 crc32。 如果slave用的 5.5 或者更早的版本,请将master的 binglog_checksum设置为 none。

才记起来我 CentOS6 安装的是 mysql 5.6 版本, Ubuntu系统上安装的是 5.5版本

root@mysql 19:22>select @@version;
+------------+
| @@version  |
+------------+
| 5.6.16-log |
+------------+
1 row in set (0.00 sec)
root@(none) 19:36>select @@version;
+------------+
| @@version  |
+------------+
| 5.5.27-log |
+------------+
1 row in set (0.00 sec)

解决步骤:

  1. 关闭 master checksum:
set global binlog_checksum='NONE';
show variables like '%checksum%';
  1. 添加 my.cnf 配置文件中添加如下设置,下次重启就可以不用做步骤1,直接生效了。
binlog_checksum=NONE
  1. 重新查询master状态:
show master status\G;

搞定。
然后我叫DAB也要把这问题好好记一下,没准下次就会遇到了。

binlog checksum功能介绍

http://blog.sina.com.cn/s/blog_53fab15a0102vodv.html

  1. 深蓝 2016-12-16 19:25 回复

    我这里预生产环境的主从是5.6的两个不同的小版本号,主5.6.22 从5.6.28,没发现这个情况。

  2. Pingback: MySQL-主从复制配置 – 唐亚军的IT笔记

发表评论 取消回复

您的电子邮箱地址不会被公开。 必填项已用*标注

评论

显示名称 *

电子邮箱地址 *

网站网址


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK