Solution to the problem of Slave_IO_Running: Connecting /Slave_IO_Running: No caused by UUID duplication in Linux virtual machine server mysql master-slave replication

Scenario 1: The following situation occurs when the UUID is the same

Since the virtual machine has been cloned for two days, the uuid of mysql is the same. When testing the master-slave replication of mysql on the Linux virtual machine , Slave_IO_Running: Connecting
/Slave_IO_Running: No appears.

The following error is reported:

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.

This is due to the duplication of UUIDs on the two servers. Solve it as follows:

[root@node01 mysql]# cd /var/lib/mysql
[root@node01 mysql]# rm -rf auto.cnf 
[root@node01 mysql]# service mysqld restart
Stopping mysqld:                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

Restart the mysql service, then log in to mysql and enter show slaves status\G . Slave_IO_Running: shows yes, successful;

 

Scenario 2: The server-id is the same

In the /etc/my.cnf configuration file, if the id value in server-id is the same, there will be an error of duplicate id. This can be solved by modifying the id value in the configuration file;

log-bin=mysql-bin
server-id=20

 

Guess you like

Origin blog.csdn.net/liuwkk/article/details/109789061