Mysql Slave没有更新

时间:2010-03-05 17:33:49

标签: mysql replication

我有复制设置每个东西看起来很好我没有错误,但数据没有被移动到奴隶

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)

2 个答案:

答案 0 :(得分:3)

在主数据库上运行show master statusshow master status\G。它会为您提供正确的值来更新您的奴隶。

从您的从属状态看起来,您的从服务器已成功连接到主服务器并正在等待日志事件。对我而言,这意味着您的从属用户已正确设置,并具有正确的访问权限。看起来您只需要同步正确的日志文件位置。

小心,因为要获得良好的同步,你应该停止主机,转储数据库,记录主日志文件位置,然后启动主机,导入从机上的数据库,最后在从机模式下启动从机使用正确的主日志文件pos。我已经做了大约30次,如果你几乎没有完全遵循这些步骤,你得到错误的同步。

答案 1 :(得分:1)

可能有几个问题

  1. 主人不知道奴隶。
  2. slave和master与中继日志文件不同步。
  3. 您必须将奴隶与未更新的主人同步。然后你开始奴隶。它应该工作正常。