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;
看到同步又開始正常了
以上方法可以不需要去拷貝數據到從庫 重新做主從同步