MySQL Replication Walkthru: Enable Replication

dataflow, howto Add comments

After Enabling Network Access, we can Enable Replication before Making a Remote Backup of the Database. If you’re reading this to simply make recurring backups of your MySQL remotely, then you can ignore this step.

In this step, we’ll

  1. assign IDs to the Primary and Secondary
  2. restart the primary
  3. proceed to backup the database before starting the Secondary

Primary: Sleepy (ID = 1)
Secondary: Doc (ID = 2)
MySQL: 5.1.41-enterprise-commercial-pro
OS: Windows 2008R2

Assign ID to the Primary
While assigning a replication ID, we can also define the binary log for replication; I did this using two parameters into the my.ini (my.cnf) file:


#bind-address= # commented to bind to all interfaces



Start the Primary server, but don’t start the secondary yet. Note that “skip-slave-start” is there as opposed to running the Secondary with the option “–skip-slave-start”, which is difficult to do using Windows’ service stop/start. This option is only there for the first run of the Secondary.

(On Sleepy/Primary)

mysql.exe -u root mysql
mysql> GRANT REPLICATION SLAVE ON *.* TO ‘repl’@'%’;

You should notice that when the Primary server starts up again, it begins creating E:Datarepl-bin.index and E:Datarepl-bin.000001 files

2 Responses to “MySQL Replication Walkthru: Enable Replication”

  1. MySQL Replication Walkthru: Making a Remote Backup Says:

    […] Well With Others MySQL Replication Walkthru: Enable Replication Nov […]

  2. MySQL Replication Walkthru: Activate Secondary Says:

    […] Enabling Replication and Making a Remote Backup), we can activate the secondary […]

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in