mysql 1032 1062_1032,1062 复制错误处理:非GTID模式跳过

1.跳过指定数量的事务:

slave stop;

SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1        #跳过一个事务

slave start

2.修改mysql的配置文件,通过slave_skip_errors参数来跳所有错误或指定类型的错误

[mysqld]

#slave-skip-errors=1062,1032                            #跳过指定error no类型的错误

#slave-skip-errors=all #跳过所有错误

错误

1032:更新或者删除找不到记录

#当删除的列在从库,不存在

Last_SQL_Errno: 1032

Last_SQL_Error: Could not execute Delete_rows event on table school.student02; Can't find record in 'student02',

Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000001, end_log_pos 1431

#当更新的列在从库,不存在(报错和上面一样)

Last_SQL_Errno: 1032

Last_SQL_Error: Could not execute Update_rows event on table school.student02; Can't find record in 'student02',

Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000001, end_log_pos 1789

1062: 主键冲突

Last_SQL_Errno: 1062Last_SQL_Error: Couldnot execute Write_rows event on table school.student02; Duplicate entry '7' for key 'PRIMARY',

Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log mysql-bin.000001, end_log_pos 2137

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值