MySQL主从复制,读写分离报错
一: MySQL同步故障:" Slave_SQL_Running:No" 两种解决办法
- 问题: IO线程能起来,SQL线程无法启动
使用中出现了这种情况,经过一番查找,终于解决
1.程序可能在slave上进行了写操作
2.也可能是slave机器重起后,事务回滚造成的.
一般是事务回滚造成的:
首先停掉Slave服务:slave stop
到主服务器上查看主机状态:
记录File和Position对应的值
1.1: 方法一 重新change master
进入master ,重新change master
mysql> show master status;
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000003 | 8935 | test1 | jzsoft |
+--------