MYSQL从库数据冲突致使同步停止怎么办

发布时间:2020-05-28 16:41:17 作者:三月
来源:网络 阅读:178

本篇文章给大家主要讲的是关于MYSQL从库数据冲突致使同步停止怎么办的内容,感兴趣的话就一起来看看这篇文章吧,相信看完MYSQL从库数据冲突致使同步停止怎么办对大家多少有点参考价值吧。    

mysql>show slave status\G;
*************************** 1. row***************************
               Slave_IO_State: Waiting formaster to send event
                  Master_Host: 172.16.1.2
                  Master_User: rep
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000003
         Read_Master_Log_Pos: 641
               Relay_Log_File:mysqld-relay-bin.000004
                Relay_Log_Pos: 251
       Relay_Master_Log_File: mysql-bin.000003
            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: 1007
                   Last_Error: Error 'Can'tcreate database 'butongbu'; database exists' on query. Default database:'butongbu'. Query: 'create database butongbu'
                 Skip_Counter: 0
         Exec_Master_Log_Pos: 550
              Relay_Log_Space: 643
              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: 1007     #错误代码1007
               Last_SQL_Error: Error 'Can'tcreate database 'butongbu'; database exists' on query. Default database: 'butongbu'.Query: 'create database butongbu'
1 row in set (0.00 sec)

根据仔细分析,解决办法如下:

stopslave;

setglobal sql_slave_skip_counter=1;

startslave;

以上关于MYSQL从库数据冲突致使同步停止怎么办详细内容,对大家有帮助吗?如果想要了解更多相关,可以继续关注我们的行业资讯板块。

推荐阅读:
  1. MySQL不停机添加从库
  2. MYSQL 主从添加新从库

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

mysql 数据库 同步

上一篇:大数据科学新发展展望:不得不知的四大趋势

下一篇:Linux系统shell脚本的用法

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》