标签:
mysql> set global sql_slave_skip_counter=1; --指定跳过一个事务
mysql> show slave status \G; *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: 192.168.3.45 Master_User: slave Master_Port: 3306 Connect_Retry: 60 Master_Log_File: slave-bin.000029 Read_Master_Log_Pos: 1550 Relay_Log_File: master-relay-bin.000056 Relay_Log_Pos: 603 Relay_Master_Log_File: slave-bin.000029 Slave_IO_Running: Yes Slave_SQL_Running: No Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 1032 Last_Error: Could not execute Update_rows event on table mysql.user; Can‘t find record in ‘user‘, Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event‘s master log slave-bin.000029, end_log_pos 1344 Skip_Counter: 0 Exec_Master_Log_Pos: 763 Relay_Log_Space: 2809 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: NULL Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 1032 Last_SQL_Error: Could not execute Update_rows event on table mysql.user; Can‘t find record in ‘user‘, Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event‘s master log slave-bin.000029, end_log_pos 1344 Replicate_Ignore_Server_Ids: Master_Server_Id: 3 Master_UUID: 2d7ca199-4ad8-11e5-b592-080027f8dc35 Master_Info_File: /data/home/mysql2/mysql/data/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: 150922 13:06:09 Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: 2d7ca199-4ad8-11e5-b592-080027f8dc35:3-5 Executed_Gtid_Set: 2d7ca199-4ad8-11e5-b592-080027f8dc35:1-3, 52b2b88e-5747-11e5-86a8-0800274bf022:1-1601492 Auto_Position: 1 1 row in set (0.00 sec)
mysql> stop slave; Query OK, 0 rows affected (0.08 sec) mysql> set GTID_NEXT= ‘2d7ca199-4ad8-11e5-b592-080027f8dc35:3‘; Query OK, 0 rows affected (0.00 sec) mysql> begin;commit; Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) mysql> set gtid_next=‘AUTOMATIC‘; Query OK, 0 rows affected (0.00 sec) mysql> start slave; Query OK, 0 rows affected (0.06 sec) mysql> show slave status \G; --查看是否有错,如果还没有跳过,则继续往下执行空事务跳过错误事务,直到SQL,IO进程均为yes即可
标签:
原文地址:http://www.cnblogs.com/qingyw/p/4885535.html