天天看点

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;#再开启复制
           

问题解决。

继续阅读