由于两边数据不一致,主库host表的某条数据在从库不存在,导致同步时执行update报错。
修复的原理很简单,找到主从不一致的这条数据,在从库补上,让update能执行就好。由于需要从binlog里找数据,需要确保中断之后的binlog没被删除,否则就只能重搭了。
导出日志:
mysqlbinlog -v --stop-position=265980893 /binlog_path/mysql-bin.000641 > /tmpbinlog.log
查询记录end_log_pos=537973695所在位置,找到对应update语句;
找到对应的数据再从库中手动添加进去,然后重启slave。
翻译
搜索
复制
<iframe></iframe> 标签:code,end,log,pos,报错,mysql,从库 From: https://www.cnblogs.com/xxhxs-21/p/18057029