Error:
1)
Change Master results in:
Last_io_error:error Connecting to master-retry-time:60 retries
2)
To stop the slave process without unlocking:
> Stop slave;
ERROR 1192 (HY000): Can ' t execute the given command because you had active locked tables or an active transaction
3)
Change master syntax error, comma dropped
Mysql> Change Master to
-Master_host= ' IP '
-master_user= ' user ',
Master_password= ' PASSWD ',
Master_log_file= ' mysql-bin.000002 ',
master_log_pos=106;
Error 1064 (42000): You have a error in your SQL syntax; Check the manual, corresponds to your MySQL server version for the right syntax to use near ' master_user= ' user ',
Master_password= ' PASSWD ',
Master_log_file= ' mysql-bin.000002 ' at line 3
4)
Change master without stopping the slave process
mysql> Change Master to master_host= ' IP ', master_user= ' user ', master_password= ' PASSWD ', master_log_file= ' Mysql-bin.000001 ', master_log_pos=106;
ERROR 1198 (HY000): This operation cannot is performed with a running slave; Run STOP SLAVE First
5)
The Server-id of a B are the same:
Last_io_error:fatal error:the slave I/O thread stops because master and slave have equal MySQL server IDs;
These IDs must be different for replication to work (or the--replicate-same-server-id option must is used on
Slave but this does don't always make sense; Please check the manual before using it).
View Server-id
Mysql> Show variables like ' server_id ';
Manually modifying Server-id
mysql> set global server_id=2; #此处的数值和my. CNF, just set it up.
mysql> slave start;
6) After change master, check the status of slave and discover that slave_io_running is no
It is important to note that the MySQL process is finally restarted after the above operation has been completed
Excerpt from: ANLJF's Column
MySQL Mutual master from replication FAQ