Feb 252010
Change MySQL replication master host
Answer:
To change the MySQL replication master host from a MySQL slave, follow the steps below.
1. Copy current master bin log file name and position
mysql> STOP SLAVE;
mysql> SHOW SLAVE STATUS\G
You will find something like the following...
Master_Log_File: mysql-bin.000081
Read_Master_Log_Pos: 3684056824
2. Change to new master using command
mysql> CHANGE MASTER TO MASTER_HOST='192.168.1.2', MASTER_LOG_FILE='mysql-bin.000081', MASTER_LOG_POS=3684056824;
mysql> START SLAVE;