mysql 1032 错误
原因是由于, 主库要同步更新到从库, 而从库没有这条记录, 导致 1032 错误, 修复的话就是找回 从库 丢失的 记录
mysql> show slave status\G;
Slave_IO_Running: Yes
Slave_SQL_Running: No
Last_Errno: 1032
Last_Error: Could not execute Update_rows event on table reptest.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000009, end_log_pos 42303
mysql 1032 修复
利用mysqlbinlog工具找出42303的事件
/usr/local/mysql-5.6.30/bin/mysqlbinlog --base64-output=decode-rows -vv mysql-bin.000009 |grep -A 20 '42303'
或者
/usr/local/mysql-5.6.30/bin/mysqlbinlog --base64-output=decode-rows -vv mysql-bin.000009 --stop-position=42303 | tail -20
或
usr/local/mysql-5.6.30/bin/mysqlbinlog --base64-output=decode-rows -vv mysql-bin.000009 > decode.log
( 或者加上参数-d, –database=name 来进一步过滤)
更新从库
mysql> insert into reptest
.t1
values (1,'aa');
Query OK, 1 row affected (0.01 sec)
mysql> start slave;
Query OK, 0 rows affected (0.03 sec)
mysql> show slave status\G;
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
转载请注明:爱开源 » mysql Error_code: 1032 错误修复