Home > Database > Mysql Tutorial > MySQL - Detailed explanation of the method of switching Master server or relay server in GTIDs Replication mode

MySQL - Detailed explanation of the method of switching Master server or relay server in GTIDs Replication mode

黄舟
Release: 2017-03-13 16:42:24
Original
1547 people have browsed it

GTIDs Replication can arbitrarily designate a serviceserver as the relay Slave server or Master server of another server.

For example, if there are three MySQL servers A, B, and C, A is the Master server of B and C. Currently, B is to be turned into a relay server for C. The specific operation method is as follows:

1. Execute the following commands on server B

mysql>  GRANT REPLICATION SLAVE ON *.* TO 'lyz'@'C的ip地址' IDENTIFIED BY 'lyz';
Copy after login

2. Execute the following operations on server C in sequence

(1) Stop slave
mysql> stop slave;
Copy after login
(2)Configure slave
mysql> change master to
	-> master_host='B的ip地址',
	-> master_port=3306,
	-> master_user='lyz',
	-> master_password='lyz',
	-> master_auto_position=1;
Copy after login
(3)Start slave
mysql > start slave;
Copy after login

The above is the detailed content of MySQL - Detailed explanation of the method of switching Master server or relay server in GTIDs Replication mode. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template