Mysql Slave 不更新 [英] Mysql Slave not updating

查看:41
本文介绍了Mysql Slave 不更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了复制,一切看起来都很好我没有错误,但是数据没有被移动到 Slave

I have replication set up every thing looks fine I have not errors , but the data is not being moved to the Slave

mysql> show slave status \G
*************************** 1. row ***************************
             Slave_IO_State: Waiting for master to send event
                Master_Host: xxxxx
                Master_User: xxxxxx
                Master_Port: xxxx
              Connect_Retry: 30
            Master_Log_File: mysql-bin.000006
        Read_Master_Log_Pos: 98
             Relay_Log_File: xxxxx-relay-bin.002649
              Relay_Log_Pos: 235
      Relay_Master_Log_File: mysql-bin.000006
           Slave_IO_Running: Yes
          Slave_SQL_Running: Yes
            Replicate_Do_DB:
        Replicate_Ignore_DB:
         Replicate_Do_Table:
     Replicate_Ignore_Table:
    Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
                 Last_Errno: 0
                 Last_Error:
               Skip_Counter: 0
        Exec_Master_Log_Pos: 98
            Relay_Log_Space: 235
            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: 0
1 row in set (0.00 sec)

推荐答案

在主数据库上运行 show master statusshow master status\G.它会给你正确的值来更新你的奴隶.

Run a show master status or show master status\G on the master DB. It will give you the correct values to update your slave with.

从您的从站状态来看,您的从站似乎已成功连接到主站并正在等待日志事件.对我来说,这意味着您的从属用户已正确设置,并且具有正确的访问权限.看起来你只需要同步正确的日志文件位置.

From your slave status, it looks like your slave has successfully connected to the master and is awaiting log events. To me, this means your slave user has been properly set up, and has the correct access. It really seems like you just need to sync the correct log file position.

小心,因为要获得良好的同步,您可能应该停止主站,转储数据库,记录主站日志文件位置,然后启动主站,在从站上导入数据库,最后以从站模式启动从站使用正确的主日志文件 pos.我已经这样做了大约 30 次,如果您几乎没有完全按照这些步骤进行操作,同步错误.

Careful, because to get a good sync, you should probably stop the master, dump the DB, record the master log file positions, then start the master, import the DB on the slave, and finally start the slave in slave mode using the correct master log file pos. I've done this about 30 times, and if you don't follow those steps almost exactly, you will get a bad sync.

这篇关于Mysql Slave 不更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆