Mysql master slave sync error: the slave’s relay log is corrupted

2019-09-1811:12:50 Comment

If the disk space is not enough, the mysql will not be login or the slave can't to write any data. In the case, we should to remove some not important data to get more empty space. If due to the binlog is too big, we can use empty the binlog (not delete the file directly), then login the mysql and use command to purge binlog.

cat /dev/null > xxxx.binlog.xxxxn     //empty the binlog file
>> purge master logs to 'mysql-bin.0000xxxx';   //clean the binlog command

When the slave sync error: the slave's relay log is corrupted. We should reset the sync position at the slave server.

First stop the slave sync "stop slave", then use "show slave status \G". We can find the message:

Relay_Master_Log_File: binlog.000338
Exec_Master_Log_Pos: 846524125

then we show reset the sync position.

change master to Master_Log_File='binlog.000338', Master_Log_Pos=846524125;

And, start the slave. Everything is ok.

>> start slave.


:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: