Mysql Slave 不更新

标签 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)

最佳答案

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

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

小心,因为要获得良好的同步,您可能应该停止 master,转储 DB,记录 master 日志文件位置,然后启动 master,在 slave 上导入 DB,最后以 slave 模式启动 slave使用正确的主日志文件 pos。我已经这样做了大约 30 次,如果您不几乎完全按照这些步骤操作,您得到一个糟糕的同步。

关于Mysql Slave 不更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2388682/

相关文章:

MYSQL SELECT COUNT 返回错误

mysql - SQL 查询中的过滤器不返回结果

mysql - 如何选择具有 2 个部分名称的表(Mysql?

couchdb 和 futon - 有没有办法取消使用 futon 的连续复制

MongoDB 复制因子

hadoop - hadoop3 中如何使用纠删码以及它们如何实现容错?

MySQL:选择 COUNT 处的记录

mysql - 为什么InnoDb不支持聚集主键的auto_increment

Java MongoDB 假装是复制从属

mysql - 将多个数据库复制到单个数据库,反之亦然