天天看點

MySQL同步故障解決 slave_sql_running=no

在MySQL5.7環境下 主從複制模式,從伺服器重新開機後發現備份停止

手動輸入

結果為:
Query OK,  rows affected ( sec)
           

然而輸入

出現一些錯誤:Slave_SQL_Running: No

*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 192.168.8.201
                  Master_User: xiaokai
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000003
          Read_Master_Log_Pos: 5383
               Relay_Log_File: xiaokai-PC-relay-bin.000002
                Relay_Log_Pos: 1028
        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:
           

解決辦法:

mysql>stop slave;#先停止複制線程
mysql> set GLOBAL SQL_SLAVE_SKIP_COUNTER=;
mysql> slave start;#再開啟複制
           

問題解決。

繼續閱讀