这篇文章主要介绍了关系型数据库从库误删数据后和gtid复制断开后怎么处理,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。 情景:应该是主库上删数据,结果从库上先删了一下,然后主库再次删的时候导致从库的同步断开 root @ xh _ test 01:58:58 show SLAVE状态\G *************************** 1.行************************** 从机输入输出状态:等待主机发送事件 主控主机: 10.13.28.52 Master_User: repl Master_Port: 3306 Connect_Retry: 60 master _ Log _ file : binlog。000006 read _ Master _ Log _ pos : 1375851 中继日志文件:中继日志。000012 继电器_日志_Pos: 1345735 中继_主_日志_文件: binlog。000006 从属输入输出运行:是 从属SQL_Running:否 Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: 复制_野生_忽略_表: MySQL .% Last_Errno: 1032 Last_Error:协调器停止,因为工作进程中有错误。最近的失败是:工人0在主日志binlog.000006,end_log_pos 1345900执行事务“a 42 E8 e 2 B- 886 a-11e 7-962 B- 00155 D1 cc 18:121”失败。请参阅错误日志和/或性能模式。复制_应用程序_状态_ by _ worker表,了解有关此故障或其他故障(如果有)的更多详细信息。 Skip_Counter: 0

          Exec_Master_Log_Pos: 1345608
              Relay_Log_Space: 1376222
              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: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 0 failed executing transaction a42e8e2b-886a-11e7-962b-00155d1cca18:121 at master log binlog.000006, end_log_pos 1345900. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id: 523306
                  Master_UUID: a42e8e2b-886a-11e7-962b-00155d1cca18
             Master_Info_File: mysql.slave_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: 180224 13:56:50
               Master_SSL_Crl: 
           Master_SSL_Crlpath: 
           Retrieved_Gtid_Set: a42e8e2b-886a-11e7-962b-00155d1cca18:2-202
            Executed_Gtid_Set: a42e8e2b-886a-11e7-962b-00155d1cca18:1-120,
a5c5f6cf-886a-11e7-8494-00155d1cca17:1-259408,
aa30ac69-886a-11e7-a031-00155d1cca1a:1-6
                Auto_Position: 1
         Replicate_Rewrite_DB: 

## 找到对应的 事务编号 然后跳过   指定的gtid一定要找对

mysql从库误删数据后和gtid复制断开后怎么处理 第1张

stop slave;
set @@session.gtid_next= a42e8e2b-886a-11e7-962b-00155d1cca18:121
begin;                        
commit;
set @@session.gtid_next=automatic; 
start slave;
show slave status\G

mysql从库误删数据后和gtid复制断开后怎么处理 第2张

感谢你能够认真阅读完这篇文章,希望小编分享的“mysql从库误删数据后和gtid复制断开后怎么处理”这篇文章对大家有帮助,同时也希望大家多多支持,关注行业资讯频道,更多相关知识等着你来学习!