FAQs about MySQL mutual master-slave Replication

Source: Internet
Author: User
Error: 1) caused by changemaster: Last_IO_Error: errorconnectingtomaster

Error: 1) Last_IO_Error: error connecting to master caused by change master

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, after completing the preceding operations, the mysql process will be restarted.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.