MySQL - Relay log read failure, Could not parse relay log

Today I got the following error for one of the MySQL slave servers I've setup in the past. The server crashed some night ago so maybe some file system problem appear.

mysql-slave> show slave status\G;

By running the above command I got the following error message:

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.

First I thought, I'm really fucked but it isn't so hard to recover from the master binary log.

  • First we stop the slave replication:
mysql-slave> stop slave;
  • We check the current state and note the following variables Relay_Master_Log_File and Exec_Master_Log_Pos:
mysql-slave> show slave status\G;
  • Reset the slave state, this will remove all relay logs including the broken ones:
mysql-slave> reset slave;
  • Setup the replication from the last master log position (remember your notes from above) and start the slave again:
mysql-slave> change master to master_log_file='[Relay_Master_Log_File]', master_log_pos=[Exec_Master_Log_Pos];
mysql-slave> start slave;

Everything should be back to normal, you could check your replication status again via show slave status\G;.


October 13, 2014, 7:01 pm


, , ,




Send your comment by mail.