您的位置:首页 > 大数据 > 人工智能

Relay log read failure解决办法

2016-09-27 23:24 393 查看
mysql数据库主从同步中断了,错误提示:

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.

解决方法:
1、找到relay-log.info,第一行记录了当前正在执行的log-relay文件名
例如:

./slave-relay-bin.001226
719572592
mysql-bin.001522
719572447

2、找到该文件的下一个文件 使用mysqlbinlog查看该文件

比方:mysqlbinlog ./slave-relay-bin.001226

看到:
Rotate to slave-relay-bin.001228 pos: 4

3、登陆mysql

stop slave;
change master to
master_host='192.168.1.168',master_user='复制账号',master_password='复制密码',master_log_file='slave-relay-bin.001227',master_log_pos= 4;
start slave;
show slave status\G;
看到同步又开始正常了

以上方法可以不需要去拷贝数据到从库 重新做主从同步
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mysql主从同步