No Data Loaded in Master

This method only works if the database is empty. If the database is not empty, then replication should be restored as described below.

# On the master
mysql> SHOW MASTER STATUS\G

# On the slave
# Use the values for <Name Logfile> and <Position LogFile> from the output above:
mysql> CHANGE MASTER TO MASTER_HOST='<acd-dbm>',MASTER_USER='repl',MASTER_PASSWORD='<passwort>',MASTER_LOG_FILE='<Name LogFile>', MASTER_LOG_POS=<Position LogFile>;

# On the slave - start the Slave
mysql> START SLAVE;

# On the slave - check status
mysql> SHOW SLAVE STATUS\G

Simple Master Slave

For a simple master slave installation, the above commands will be input only once.

Master-Master Replication

For Master-Master replication with two additional slaves, the replication is setup as follows:

WhatMasterSlave
Replicate the first master to the second master.acd-dbm1acd-dbm2
Replicate the second master to the first master.acd-dbm2acd-dbm1
Replicate the first master to the first slave. acd-dbm1acd-dbs1
Replicate the second master to the second slave. acd-dbm2acd-dbs2

Master is not Empty

If the master is not empty, then use one of the following pages to reconstruct replication:

Restore MySQL Master Slave Replication

Restore MySQL Master-Master Replication

  • No labels