17.1.1 How to Set Up Replication Setting the Replication Master Configuration Setting the Replication Slave Configuration Creating a User for Replication Obtaining the Replication Master Binary Log Coordinates Creating a Data Snapshot Using mysqldump Creating a Data Snapshot Using Raw Data Files Setting Up Replication with New Master and Slaves Setting Up Replication with Existing Data Introducing Additional Slaves to an Existing Replication Environment Setting the Master Configuration on the Slave

This section describes how to set up complete replication of a MySQL server. There are a number of different methods for setting up replication, and the exact method to use depends on how you are setting up replication, and whether you already have data within your master database.

There are some generic tasks that are common to all replication setups:

After configuring the basic options, select your scenario:

Before administering MySQL replication servers, read this entire chapter and try all statements mentioned in Section 13.4.1, “SQL Statements for Controlling Master Servers”, and Section 13.4.2, “SQL Statements for Controlling Slave Servers”. Also familiarize yourself with the replication startup options described in Section 17.1.4, “Replication and Binary Logging Options and Variables”.


Certain steps within the setup process require the SUPER privilege. If you do not have this privilege, it might not be possible to enable replication.