Recover from mysql log read failure

From Wiki
Jump to: navigation, search

If you deal with MySQL master/slaves a lot you may run into the following error.

Relay log read failure: Could not parse relay log event entry.

To fix this you will need to reset the slave and request a new copy of the bin logs from the master. Use the following procedure to do this.

1. STOP SLAVE

2. SHOW SLAVE STATUS - copy pasta to your notepad, pastebin, etc.

3. RESET SLAVE

4. CHANGE MASTER:

CHANGE MASTER TO MASTER_USER='slave', MASTER_PASSWORD='password',
MASTER_HOST='host.example.com', MASTER_LOG_FILE='<relay_master_log_file>', MASTER_LOG_POS=<exec_master_log_pos>

5. START SLAVE