当前位置: 移动技术网 > IT编程>数据库>Mysql > Mysql主从同步Last_IO_Errno:1236错误解决方法

Mysql主从同步Last_IO_Errno:1236错误解决方法

2017年12月07日  | 移动技术网IT编程  | 我要评论

林嘉文诈骗,中国数字家电网,360定时关机怎么设置

mysql主从同步的last_io_errno:1236错误是什么原因呢,我们要如何来解决这个问题呢?下面和小编一起来看看关于此问题的记录与解决办法。

<script>ec(2);</script>

从服务器错误代码:

last_io_errno: 1236
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 'mysql-bin.000005' at 16750821, the last event read from '/usr/local/mysql/binlog/mysql-bin.000005' at 16750821, the last byte read from '/usr/local/mysql/binlog/mysql-bin.000005' at 120.'

大概分析了一下原因,个人认为很可能的因素的由于①mysql版本不同导致;②备份不完全导致的。之前配置版本相同的mysql是不存在这个问题的。(时间问题,没有具体测试原因)

主服务器由于上次php导致的宕机,升级到了最新版本的mysql(5.6.29),而从服务器我刚刚编译的时候使用的5.5.49这个版本的db,因此推断可能是由于这个问题导致的,没有去看官方文档,只是个人猜测。

版本不同导致的另外一个问题是:

[root@backup tmp]# /usr/local/mysql/bin/mysql -uroot -p <./all.sql 
enter password: 
error 1064 (42000) at line 279: you have an error in your sql syntax; check the manual that corresponds to your mysql server version for the right syntax to use near 'stats_persistent=0' at line 11

我偷懒,直接重新编译一个相同版本的mysql了事,具体原因和版本不同,没有仔细研究。

slave临时跳过错误方法:

mysql

mysql>slave stop;  #stop slave
mysql>set global sql_slave_skip_counter = 1;
mysql>slave start;  #start slave

slave永久跳过错误的方法:

vi /etc/my.cnf
[mysqld]
slave-skip-errors=1062,1053,1146 #跳过指定error no类型的错误
#slave-skip-errors=all #跳过所有错误

总结

以上就是本文关于mysql主从同步last_io_errno:1236错误解决方法的全部内容,希望对大家有所帮助。如果您有什么更好的处理方法,可以留言,大家一起交流讨论。

感兴趣的朋友可以参阅:mysql表排序规则不同错误问题分析企业生产mysql优化介绍mysql子查询和嵌套查询优化实例解析等,有问题请留言,小编会及时回复大家。感谢朋友们对本站的支持!

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网