mysql主从Relay log read failure解决

我的树莓派作为博客的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上操作)。

找到断点

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

停止主从

修改同步起点

重启同步

重新检查同步是否恢复:

 

如果文章帮助到你,那么帮我点一下广告 or 打赏1元钱,服务器费用需要大家的支持。

发表评论

电子邮件地址不会被公开。