mysql主从跳过事务_主从跳过事务

普通主从:

跳过一个事务

mysql> set global sql_slave_skip_counter=1;

Query OK, 0 rows affected (0.00 sec)

mysql> start slave;

GTID主从:

跳过一个GTID

(root@localhost) [(none)]> show slave status\G

*************************** 1. row ***************************

Slave_IO_State: Waiting for master to send event

Master_Host: 192.168.1.201

Master_User: root

Master_Port: 3306

Connect_Retry: 60

Master_Log_File: mysql-bin.000013

Read_Master_Log_Pos: 3163

Relay_Log_File: relay-bin.000002

Relay_Log_Pos: 2348

Relay_Master_Log_File: mysql-bin.000013

Slave_IO_Running: Yes

Slave_SQL_Running: No

Last_Errno: 1062

Last_Error: Could not execute Write_rows event on table test.t; Duplicate entry '3' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log mysql-bin.000013, end_log_pos 2611

Skip_Counter: 0

Exec_Master_Log_Pos: 2381

Relay_Log_Space: 3371

Until_Condition: None

Last_SQL_Errno: 1062

Last_SQL_Error: Could not execute Write_rows event on table test.t; Duplicate entry '3' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log mysql-bin.000013, end_log_pos 2611

Replicate_Ignore_Server_Ids:

Master_Server_Id: 1921681201

Master_UUID: 766d5362-c923-11e6-85b5-000c29de38de

Master_Info_File: /app/mysqldata/3306/data/master.info

Retrieved_Gtid_Set: 766d5362-c923-11e6-85b5-000c29de38de:4-14

Executed_Gtid_Set: 766d5362-c923-11e6-85b5-000c29de38de:1-11,

ff3d06c1-c923-11e6-8fbf-000c295f1558:1-2

Auto_Position: 1

Replicate_Rewrite_DB:

Channel_Name:

Master_TLS_Version:

1 row in set (0.00 sec)

(root@localhost) [(none)]> stop slave;

(root@localhost) [(none)]> set GTID_NEXT='766d5362-c923-11e6-85b5-000c29de38de:12';

(root@localhost) [(none)]> begin;commit;

(root@localhost) [(none)]> set GTID_NEXT='AUTOMATIC';

(root@localhost) [(none)]> start slave;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值