首页 > nginx > 解决 mysql 1594 错误

解决 mysql 1594 错误

2020年11月19日 发表评论 阅读评论

1.查看show slave status\G发现
Last_SQL_Errno: 1594
Last_SQL_Error: 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.

查看mysql的 errlog 可以看到
2020-10-19T00:43:54.692107Z 11 [ERROR] Slave SQL for channel '': 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. Error_code: 1594
2020-10-19T00:43:54.692113Z 11 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'master-log.013491' position 893944284.

根据errorlog的提示,重新设置主从
stop slave ;
change master to master_host='172.21.101.10',master_port=3307,master_user='repl',master_password='repl',master_log_file='mysql-bin.013491', master_log_pos=893944284;
start slave;

2.执行 change master to master_host= xxxxxxx 报错

ERROR 1776 (HY000): Parameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is active.

解决方法 change master to master_auto_position=0

然后重新执行上面第一步的步骤。

分类: nginx 标签:
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.