No Data Loaded in Master Note |
---|
This method only works if the database is empty. If the database is not empty, then replication should be restored as described below. |
Status |
---|
colour | Red |
---|
title | Caution Password |
---|
|
Translations Ignore |
---|
Code Block |
---|
# 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='<acdacd-dbm>dbm',MASTER_USER='repl',MASTER_PASSWORD='<passwort><password>',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 SlaveFor a simple master slave installation, the above commands will be input only once. Master-Master ReplicationFor Master-Master replication with two additional slaves, the replication is setup as follows: What | Master | Slave |
---|
Replicate the first master to the second master. | acd-dbm1 | acd-dbm2 | Replicate the second master to the first master. | acd-dbm2 | acd-dbm1 | Replicate the first master to the first slave. | acd-dbm1 | acd-dbs1 | Replicate the second master to the second slave. | acd-dbm2 | acd-dbs2 |
Master is not EmptyIf 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 |