0% found this document useful (0 votes)
15 views10 pages

MySQL Master Slave Replication in Windows PDF

Uploaded by

saradabharati07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views10 pages

MySQL Master Slave Replication in Windows PDF

Uploaded by

saradabharati07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

MySQL Master-

Slave
Replication in
Windows
MySQL master-slave replication in Windows enables data
synchronization between multiple database servers. This powerful
feature enhances data availability, load balancing, and backup
by PRATEEK
strategies for Windows-based MySQL deployments.
MOHANTY .
What is
MySQL
Replication?
Data Mirroring Asynchronous
1 2 Process
MySQL replication copies
data from one server Changes on the master
(master) to one or more are recorded in binary
servers (slaves). logs and applied to
slaves asy n ch ron
ously.

3 Continuous Synchronization
Slaves continuously pull and apply changes from the
master to maintain data consistency.
Benefi ts of
Replication
Scalability Data Protection High Availability
Distribute read operations across Create real-time backups on Implement failover mechanisms
multiple slave servers to improve slave servers, reducing the risk of to ensure continuous database
performance and handle higher data loss. access during server failures or
traffic. maintenance.
Replication
Topologies
Single-Master Chain
One master server replicates to multiple slaves in a
linear chain.

Master-Multi-Slave
One master server replicates directly to multiple slave servers
simultaneously.

Circular Replication
Multiple servers form a circle, each acting as both master
and slave.
Setting up Master-
Slave Replication
Preparation
1 Install MySQL on both master and slave Windows
servers. Ensure network connectivity between
them.

2 Master Confi guration


Enable binary logging and set a unique server ID
on the master server.

3 Slave Confi guration


Configure the slave to connect to the master and
begin replication process.

4 Verifi cation
Check replication status and test data
synchronization between master and slave
servers.
Confi guring the
Master Server
my.ini Create Replication
Modifi cations User
Edit the my.ini file to enable Create a MySQL user with
binary logging and set a replication slave privileges on
unique server ID. the master server.

Obtain Binary Log Restart MySQL


Info Service
Record the current binary log Restart the MySQL service
file name and position for on Windows to apply the
slave configuration. configuration changes.
Confi guring the
Slave Server
Set Server ID
Assign a unique server ID to the slave in the
1
my.ini configuration file.

Confi gure Master Info


Specify master host, port, and replication user
2
credentials in slave settings.

Set Replication Coordinates


Use CHANGE MASTER TO command to set binary log
3
file and position.

Start Slave Process


Execute START SLAVE command to initiate the
4
replication process on the slave.
Verifying
Replication Status
Command Purpose

SHOW MASTER View current binary log

STATUS position
on master
SHOW SLAVE
Check slave's replication
STATUS
status
SHOW and any errors

PROCESSLIST Monitor replication threads

on
both servers
Failover and
Switchover
Automate
1 2
Manual
d
Failover Switchover
Use tools like MySQL Promote a slave to master
Utilities or third-party role during planned
solutions for automatic maintenance or server
master failover. migrations.

3 Data Consistency
Ensure all slaves are fully synchronized before performing
failover or switchover operations.
Monitoring and
Troubleshooting

Error Logs Network Latency Data Consistency


Regularly check MySQL error logs on Monitor network latency between Perform periodic data consistency
both master and slave for replication master and slave to ensure timely checks to verify successful replication
issues. data synchronization. of all data.

You might also like