Related Documentation Download this Excerpt
PDF (US Ltr) - 1.1Mb
PDF (A4) - 1.1Mb
HTML Download (TGZ) - 279.8Kb
HTML Download (Zip) - 286.4Kb


MySQL Replication  /  ...  /  Setting Up Replication with New Source and Replicas

2.1.7 Setting Up Replication with New Source and Replicas

The easiest and most straightforward method for setting up replication is to use new source and replica servers.

You can also use this method if you are setting up new servers but have an existing dump of the databases from a different server that you want to load into your replication configuration. By loading the data into a new source, the data will be automatically replicated to the replicas.

To set up replication between a new source and replica:

  1. Configure the MySQL source with the necessary configuration properties. See Section 2.1.1, “Setting the Replication Source Configuration”.

  2. Start up the MySQL source.

  3. Set up a user. See Section 2.1.3, “Creating a User for Replication”.

  4. Obtain the source's status information, or a copy of the source's binary log index file made during a shutdown for the data snapshot. See Section 2.1.4, “Obtaining the Replication Source Binary Log Coordinates”.

  5. On the source, release the read lock:

    mysql> UNLOCK TABLES;
  6. On the replica, edit the MySQL configuration. See Section 2.1.2, “Setting the Replica Configuration”.

  7. Start up the MySQL replica server.

  8. Execute a CHANGE MASTER TO statement to set the replication source server configuration. See Section 2.1.10, “Setting the Source Configuration on the Replica”.

Perform the replica setup steps on each replica.

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 a different existing database server, you will now need to run the dump file generated from that server on the new source. The database updates will automatically be propagated to the replicas:

shell> mysql -h source < fulldb.dump