Documentation Home
MySQL 5.6 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 28.7Mb
PDF (A4) - 28.7Mb
Man Pages (TGZ) - 189.1Kb
Man Pages (Zip) - 302.2Kb
Info (Gzip) - 2.8Mb
Info (Zip) - 2.8Mb
Excerpts from this Manual

MySQL 5.6 Reference Manual  /  ...  /  Setting Up Replication with New Source and Replicas 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 is 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, “Setting the Replication Source Configuration”.

  2. Start up the MySQL source.

  3. Set up a user. See Section, “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, “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, “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, “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 must now run the dump file generated from that server on the new source. The database updates are automatically propagated to the replicas:

$> mysql -h source < fulldb.dump