mysql配置主从模式Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work.

搭建MyCat环境实现数据库读写分离时,配置MySQL主从模式完毕后,查看slave配置中出错:

Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work.

  

 

 出错原因:由于两个主机是从同一母机克隆下来的,所以mysql环境配置相同,即主从mysql的UUID相同,然而在配置主从模式要求UUID不能相同,所以出现此问题。

解决方法:

 在slave虚拟机上将UUID的配置文件(即auto.cnf)删除,然后重启mysql服务即可。

<shell> rm -rf /var/lib/mysql/auto.cnf 

<shell> service mysqld restart

  


如何查找auto.cnf文件位置

find / -name 文件名称

  

 

posted @ 2019-10-12 16:20  baishu  阅读(1402)  评论(0)    收藏  举报