问题
在从库上执行show slave status;
,查看主从状态:
Could not execute Update_rows_v1 event on table perf.m_account; Can't find record in 'm_account', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mariadb-bin.000010, end_log_pos 95979214
解决
在主库上查询二进制日志记录
/usr/bin/mysqlbinlog -v --stop-position=95979214 /var/lib/mysql/mariadb-bin.000010 > sql.log
查看记录end_log_pos 95979214
在日志文件的第几行
cat sql.log | awk '/end_log_pos 95979214/{print NR}'
查看前后内容,找到执行的sql语句
cat sql.log | awk 'NR==3571470,NR==3571520'
修复完成后,在从库上重新执行start slave
Comments | NOTHING