免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5749 | 回复: 1
打印 上一主题 下一主题

mysql 主从同步问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-09-02 14:43 |只看该作者 |倒序浏览
mysql主库使用5.5版本,从库使用5.6版本,从库配置如下:
relay-log=/data/log/relay-bin


replicate_do_db = xxx

理论上只同步xxx数据库,但现从库产生1146错误:
mysql> show slave status\G;
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 10.0.0.1
                  Master_User: replicate
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000396
          Read_Master_Log_Pos: 56617619
               Relay_Log_File: relay-bin.000004
                Relay_Log_Pos: 434081025
        Relay_Master_Log_File: mysql-bin.000392
             Slave_IO_Running: Yes
            Slave_SQL_Running: No
              Replicate_Do_DB: xxx
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 1146
                   Last_Error: Error 'Table 'bbb.tb_operlist' doesn't exist' on query. Default database: 'xxx'. Query: 'insert into bbb.tb_operlist(lydh,bwldh,oper,CreateTime,result) values('644678045','701055607669','tuijianbiao',now(),'换货')'
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 434080866
              Relay_Log_Space: 4351596338
              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: 1146
               Last_SQL_Error: Error 'Table 'bbb.tb_operlist' doesn't exist' on query. Default database: 'xxx'. Query: 'insert into bbb.tb_operlist(lydh,bwldh,oper,CreateTime,result) values('644678045','701055607669','tuijianbiao',now(),'换货')'
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 1
                  Master_UUID:
             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: 130901 22:42:57
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set:
                Auto_Position: 0


怎么会执行bbb这个库的插入语句呢,应该在读取binlog时不会将这部分日志读取才对啊,请哪个大大解答下??

论坛徽章:
0
2 [报告]
发表于 2013-09-02 14:54 |只看该作者
你执行插入的时候,是用的database.tablname 方式么? 如果必须用replicate_do_db = xxx 这个参数的话,建议你执行的时候,尽量先use database 然后在执行相关语句。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP