暂无图片
mysql主从复制,报错errno:1594
我来答
分享
Z
zclinux
2020-11-27
mysql主从复制,报错errno:1594

论坛大佬们好,想请教一根问题,mysql主从遇到了一个报错 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

网上的办法是重建binlog_file 和master_log_pos, 如果这样操作的话,备库备份的数据和主库的数据还一致么,是不是会缺少pos值之前的数据呢?
还是mysql会自动将前面缺少的内容通过binlog来补齐呢?

我来答
添加附件
收藏
分享
问题补充
2条回答
默认
最新
Cui Hulong

数据不会是丢失。
1.show slave status命令能看到从库的回放执行到那个position。
2.指定binlog_file 和master_log_pos 就可以。
3.一定要确认从库的binlog执行到哪里了,有必要跟主库的binlog内容进行对比

要是还是觉得不把握,重新搭建从库即可。最好使用gtid方式,就不会存在这样的问题。自动会确认gtid的位置。

暂无图片 评论
暂无图片 有用 0
Z
zclinux

感谢大佬的解答~

暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏