Slave_SQL_Running: No MySQL 同步故障解决如果数据不同步可以尝试该资料 MySQL> show slave status\G
- Slave_IO_Running: Yes
- Slave_SQL_Running: No
- Last_Errno: 1062
- ....
Seconds_Behind_Master:NULL 原因: 1. 程序可能在 slave 上进行了写操作 2. 也可能是 slave 机器重起后, 事务回滚造成的. 解决办法 I:1. 首先停掉 Slave 服务: slave stop2. 到主服务器上查看主机状态: 记录 File 和 Position 对应的值. MySQL> show master status;
- +------------------+-----------+--------------+------------------+
- | File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
- +------------------+-----------+--------------+------------------+
- | MySQL-bin.000020 | 135617781 | | |
- +------------------+-----------+--------------+------------------+
1 row in set (0.00 sec)3. 到 slave 服务器上执行手动同步: MySQL> change master to
- > master_host='master_ip',
- > master_user='user',
- > master_password='pwd',
- > master_port=3307,
- > master_log_file='mysql-bin.000020',
- > master_log_pos=135617781;
- 1 row in set (0.00 sec)
- MySQL> slave start;
1 row in set (0.00 sec) 再次查看 slave 状态发现: Slave_IO_Running: Yes
- Slave_SQL_Running: Yes
- ...
Seconds_Behind_Master: 0 解决办法 II:MySQL> slave stop;
- MySQL> set GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
- MySQL> slave start;
来源: http://www.bubuko.com/infodetail-3091285.html