Bootstrap

Ubuntu系统下mysql主从复制Replica_IO_Running状态为connecting的解决方案

Ubuntu系统下mysql主从复制Replica_IO_Running状态为connecting的解决方案

参考博客

在Ubuntu系统下尝试网上其他解决方法仍然没有解决问题,在上述链接中发现如果Slave_IO_Running或者Slave_SQL_Running不同时为YES,且存在如下报错:

ERROR 1200 (HY000): The server is not configured as slave; fix in config file or with CHANGE MASTER TO

则可以尝试在从节点虚拟机上删除已安装的mysql:

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.7 mysql-client-core-5.7
OR(sudo apt-get remove --purge mysql*)
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean

然后重新安装mysql:

sudo apt-get install mysql-server mysql-client

之后按照正常流程重新配置主从复制,成功连接:

Replica_IO_Running: Yes
Replica_SQL_Running: Yes

报错原因:如果采用虚拟机复制,会发生节点错误,建议在复制的虚机上删除后重新安装

;