首页 > 数据库技术 > 详细

MySQL从库不能同步,报错Relay log read failure

时间:2015-01-23 18:34:15      阅读:503      评论:0      收藏:0      [点我收藏+]


问题:MySQL从库的数据不能同步,从库SHOW SLAVE STATUS提示如下错误:

Last_SQL_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master‘s binary log is corrupted (you can check this by running ‘mysqlbinlog‘ on the binary log), the slave‘s relay log is corrupted (you can check this by running ‘mysqlbinlog‘ on the relay log), a network problem, or a bug in the master‘s or slave‘s MySQL code. If you want to check the master‘s binary log or slave‘s relay log, you will be able to know their names by issuing ‘SHOW SLAVE STATUS‘ on this slave.


尝试:

sql线程无法读取relay-log,估计relay-log损坏!

尝试重启slave

stop slave;

start slave;

查看状态仍旧是该错误!


解决办法:

(1)查看MySQL的错误日志,记录最后两个数字:

tail /opt/mysql_log/mysql_error.err
2015-01-23 16:34:30 1962 [ERROR] Error reading relay log event: slave SQL thread aborted because of I/O error
2015-01-23 16:34:30 1962 [ERROR] Slave SQL: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master‘s binary log is corrupted (you can check this by running ‘mysqlbinlog‘ on the binary log), the slave‘s relay log is corrupted (you can check this by running ‘mysqlbinlog‘ on the relay log), a network problem, or a bug in the master‘s or slave‘s MySQL code. If you want to check the master‘s binary log or slave‘s relay log, you will be able to know their names by issuing ‘SHOW SLAVE STATUS‘ on this slave. Error_code: 1594
2015-01-23 16:34:30 1962 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log ‘logbin.000054‘ position 1278235

(2)停止从库复制     

stop slave;

(3)尝试重新定位主库 

change master to master_log_file=‘logbin.000054‘,master_log_pos=1278235;

(4)开启从库复制     

start slave;


本文出自 “◆峰回路转◇2015启程◆” 博客,请务必保留此出处http://huangfuff.blog.51cto.com/2632203/1607491

MySQL从库不能同步,报错Relay log read failure

原文:http://huangfuff.blog.51cto.com/2632203/1607491

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!