Skip to content

Change MySQL replication master host

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;

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  1. MySQL binary log files take all of my disk space
  2. Set the auto increment start value in MySQL?
  3. Change the maximum allowed binary log file size in MySQL
  4. How to dump an MySQL/InnoDB database
  5. Reset MySQL root password

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*