为了账号安全,请及时绑定邮箱和手机立即绑定

从基于日志的复制到基于事务的复制总是提示出错,求助高手

在日志模式复制时都很正常,一切换到基于事务模式就提示以下错误,纳闷ing.......

基于日志时可以指定复制的log和position,但切换到事务模式时貌似会从很早的时候重做,不知道该怎么救火,求高手


mysql> show slave status \G

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

               Slave_IO_State: Waiting for master to send event

                  Master_Host: 192.168.16.140

                  Master_User: dba

                  Master_Port: 3306

                Connect_Retry: 60

              Master_Log_File: mysql-bin.000035

          Read_Master_Log_Pos: 194

               Relay_Log_File: localhost-relay-bin.000002

                Relay_Log_Pos: 414

        Relay_Master_Log_File: mysql-bin.000014

             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 Delete_rows event on table dba.t; Can't find record in 't', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000014, end_log_pos 744

                 Skip_Counter: 0

          Exec_Master_Log_Pos: 452

              Relay_Log_Space: 10758

              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 Delete_rows event on table dba.t; Can't find record in 't', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000014, end_log_pos 744

  Replicate_Ignore_Server_Ids: 

             Master_Server_Id: 1

                  Master_UUID: 1e4c5982-901f-11e8-968c-000c29c409e8

             Master_Info_File: /data/mysql/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: 180807 19:19:43

               Master_SSL_Crl: 

           Master_SSL_Crlpath: 

           Retrieved_Gtid_Set: 1e4c5982-901f-11e8-968c-000c29c409e8:3-4

            Executed_Gtid_Set: 1e4c5982-901f-11e8-968c-000c29c409e8:1-2:5,

f897b6a2-8fa6-11e8-b946-000c29a0453f:1-256

                Auto_Position: 1

         Replicate_Rewrite_DB: 

                 Channel_Name: 

           Master_TLS_Version: 

1 row in set (0.00 sec)


正在回答

2 回答

主从的数据库数据不一致,在从库执行删除行时候,找不到相应的数据,所以报错

0 回复 有任何疑惑可以回复我~

Slave_SQL_Running停止,主库和备库的数据不一致,同步的时候备库找不到相关的数据,错误位置是mysql-bin.000014,end_log_pos 744.

先在备库备份恢复主库的数据,再开始复制。

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
MySQL5.7复制功能实战
  • 参与学习       34885    人
  • 解答问题       37    个

了解最新版的MySQL数据库,领略MySQL5.7强大的复制功能

进入课程

从基于日志的复制到基于事务的复制总是提示出错,求助高手

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信