background image
3 分钟解决 MySQL 主从 1594 错误
简介
Part1:写在最前
1594 这个错误看起来挺严重的,会提示你 binlog 文件或者 Relay log 损坏了,例如
binary
log
is
corrupted、relay log is corrupted 之类的看起来很吓人是吧,多数
是由于掉电引发的,这也说明了机房配备 UPS 的重要性。本文来自真实生产案例,感谢网友
加内特提供,本人加以故障重现校验。一起来看下如何解决吧。
Part2:完整报错信息
1
2
3
4
5
6
7
8
9
1
0
1
1
1
2
1
3
1
4
1
5
1
6
1
7
1
8
1
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting
for
master to send event
Master_Host: 192.168.1.250
Master_User: mysync
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000006
Read_Master_Log_Pos: 2091061
Relay_Log_File: mysql-relay-bin.000002
Relay_Log_Pos: 1675027
Relay_Master_Log_File: mysql-bin.000006
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 1594
Last_Error: Relay log
read
failure: Could not parse
relay log event entry. The possible reasons are: the master
's binary lo
g is corrupted (you can check this by running '
mysqlbinlog
' on the bina
ry log), the slave'
s relay log is corrupted (you can check this by runn
ing
'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 bina
ry log or slave'
s relay log, you will be able to know their names by is