Error:
1)
Caused by changing the master:
Last_IO_Error: error connecting to master 'repl1 @ IP: 100'-retry-time: 60 retries
2)
Stop the slave process without unlocking:
Mysql> stop slave;
ERROR 1192 (HY000): Can't execute the given command because you have active locked tables or an active transaction
3)
The change master syntax is incorrect. A comma is dropped.
Mysql> change master
-> Master_host = 'IP'
-> Master_user = 'user ',
-> Master_password = 'passwd ',
-> Master_log_file = 'mysql-bin.000002 ',
-> Master_log_pos = 106;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that 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 be completed MED with a running slave; run stop slave first
5)
Server-id of a B is 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 be used on
Slave but this does not always make sense; please check the manual before using it ).
View server-id
Mysql> show variables like 'server _ id ';
Manually modify server-id
Mysql> set global server_id = 2; # The value here is the same as that set in my. cnf.
Mysql> slave start;
6) after changing the master, check the slave status and find that slave_IO_running is NO.
Note that the mysql process will be restarted after the preceding operations are completed.
From: ANLJF's column