mysql主从Relay log read failure解决

栏目: 数据库 · 发布时间: 7年前

内容简介:我的树莓派作为博客的mysql slave,一直在备份数据。前几日折腾树莓派,频繁重启树莓派,可能导致relay log损坏了,show slave status显式主从同步错误:解决方法如下(在slave上操作)。

我的树莓派作为博客的mysql slave,一直在备份数据。

前几日折腾树莓派,频繁重启树莓派,可能导致relay log损坏了,show slave status显式主从同步错误:

 Last_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.

解决方法如下(在slave上操作)。

找到断点

show slave status\G;

找到Relay_Master_Log_File和Exec_Master_Log_Pos,表示目前同步到了master的哪个binlog文件,以及binlog文件的哪个偏移量。

停止主从

stop slave;

修改同步起点

change master to master_log_file='bin.000001' , master_log_pos=242312863;

重启同步

start slave;

重新检查同步是否恢复:

show slave status\G;

博主无私的分享着知识,你愿意送他一顿热腾腾的早餐吗?

mysql主从Relay log read failure解决

以上所述就是小编给大家介绍的《mysql主从Relay log read failure解决》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

关乎天下

关乎天下

关明生 / 学林出版社 / 2005-8 / 8.00元

《关乎天下:中小企业赢取江山的秘诀》收录了作者多年在大企业(如阿里巴巴网站)从事管理基层得到的经验,可为众多中小企业提供招贤纳士和销售管理方面的新思路。一起来看看 《关乎天下》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

MD5 加密
MD5 加密

MD5 加密工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换