Home >Database >Mysql Tutorial >MySQL - Detailed explanation of the method of switching Master server or relay server in GTIDs Replication mode
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:
mysql> GRANT REPLICATION SLAVE ON *.* TO 'lyz'@'C的ip地址' IDENTIFIED BY 'lyz';
mysql> stop slave;
mysql> change master to -> master_host='B的ip地址', -> master_port=3306, -> master_user='lyz', -> master_password='lyz', -> master_auto_position=1;
mysql > start slave;
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!