Setup MySQL 5.1 Replication on Windows Servers

On June 25, 2010, in Programming, by Akash Kava

This article illustrates step by step procedure of how to setup MySQL Master to Slave Asynchronous Replication with MySQL 5.1 Server and with MySQL Workbench tools 5.2 on Windows Server.

Installation

You need to download MySQL from the corresponding download location and install “Windows Installer Package” and make sure you install the edition with Server configuration wizard and configure your server accordingly.

You have to setup 2 servers, one as Master and one as Slave, and both must be accessible via TCP/IP to each other.

Also configure Workbench to open localhost connection for administration.

Configure Bin Log on Master

Open configuration on Master and setup following options in Log Files to configure bin log.

MySQL-Replication-Master-Bin-Log

Configure Master Server ID

MySQL-Replication-Master-Server-ID

Configure Replication User ID on Master

In order for Slave to access your server, you must setup a user “replication_user” (you can choose your own name) and give replication access as shown in picture.MySQL-Replication-Master-User

Configure Replication Slave Server ID

Now go to your Slave server and set its Server ID as shown below.

MySQL-Replication-Slave-Server-ID

Configure Replication Settings on Slave

This is the last step to configure your Slave server, please make sure you enter correct address of your Master server and username and password as shown below. Just tick the Master info file name and give a path of file on any folder, even if file does not exist, dont worry, it will be created automatically by slave server.

MySQL-Replication-Slave-Settings

Start Slave

The final step is to open query browser and run the query “START SLAVE”.

Share
Tagged with: