mysql database master-slave synchronization problem solving-the road to dream

Solve the problem of mysql master-slave replication:

报错信息如下:
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.

Cause Analysis:

Relay log interruption or network failure

Solution:

Check show slave status\G;
find the following:
 Master_Log_File: mysql-bin.000049
 Read_Master_Log_Pos: 67691711

 Stop the slave and reset the synchronization based on the binlog file that the slave has read and the position that has been executed. A new relay log will be generated and the problem will be solved.
 
 stop slave;
 
 change master to master_log_file='mysql-bin.000049', master_log_pos=67691711;
 
 
 Verification: show slave status\G;

Guess you like

Origin blog.csdn.net/qq_34777982/article/details/109715598