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:  

6 Responses to Setup MySQL 5.1 Replication on Windows Servers

  1. Mike says:

    Works great.

    I needed to restart both server before starting the slave with: “START SLAVE”.

    Thanks for the great work!
    Mike

  2. Another Mike says:

    Thanks!
    I’d like to see the steps of getting the Master position, export/import, and setting Slave position added into the tutorial (or at least linked/referenced).

  3. Muhammad Tausif says:

    unable to replicate the database please tell me in detail

  4. Muhammad Tausif says:

    me using mysql workbench 5.2 CE .here on this .could not see the options uhave for the configurations.kindly send me the web path to download the apporiate mysql and mysql workbench tool version

    Regards

    Muhammad Tausif

  5. Patrick says:

    > me using mysql workbench 5.2 CE .here on this .could not see the options uhave for the configurations.kindly send me the web path to download the apporiate mysql and mysql workbench tool version

    Same problem here, does anybody know why the master configurations are missing under the replication tab? I tried 3 servers and it’s missing all the time.

  6. Al says:

    a very clear procedure for creating mysql replication is listed at How to create Replication on Mysql: Step by step

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>