Setting up replication with a new Master and Slaves (i.e. with no existing data) is the easiest and most straightforward method for setting up replication.
You can also use this method if you are setting up new servers and have an existing dump of the databases that you want to load into your replication configuration. By loading the data onto a new master, the data will be automatically replicated to the slaves.
To set up replication between a new master and slave:
Configure the MySQL master with the necessary configuration properties. See Section 6.1.1.2, “Setting the Replication Master Configuration”.
Start up the MySQL master.
Setup a user, see Section 6.1.1.1, “Creating a User For Replication”.
Obtain the master status information. See Section 6.1.1.4, “Obtaining the Master Replication Information”.
Free the read lock:
mysql> UNLOCK TABLES;
On the slave, edit the MySQL configuration. See Section 6.1.1.3, “Setting the Replication Slave Configuration”.
Start up the MySQL slave.
Execute the CHANGE MASTER command to set
the master replication server configuration.
Because there is no data to load or exchange on a new server configuration you do not need to copy or import any information.
If you are setting up a new replication environment using the data from an existing database server, you will now need to run the dump file on the master. The database updates will automatically be propagated to the slaves:
shell> mysql -h master < fulldb.dump

User Comments
Add your own comment.