Secure MySQL/MariaDB Master‑Slave Replication with SSL: Step‑by‑Step Guide
This guide walks through securing MySQL/MariaDB master‑slave replication over a network using SSL encryption, covering environment setup, certificate generation, server configuration, replication testing, troubleshooting common errors, and ensuring only SSL‑based replication users can connect.
Introduction
Backing up databases is a top priority in production environments. When replication must cross a network, MySQL/MariaDB’s native master‑slave replication transmits data in clear text, so securing the channel with SSL encryption is essential.
Deployment Configuration
Experiment Topology
Experiment Environment
System: CentOS 6.6
Database version: mariadb‑5.5.36
Configure Master‑Slave Replication
Install MariaDB
Provide Configuration and Script Files
Master Server Configuration
Authorize Slave Replication Account
View Binary Log Position
Slave Server Configuration
Slave Connects to Master Server
View Slave Status
Master‑Slave Replication Test
Master Server Adds Data
View Slave Data and Status
Implement SSL Secure Transmission
Check SSL Status
Configure Master as CA
CA configuration details are omitted; see earlier posts for full CA setup.
Master Server Generates Certificate
Slave Server Generates Certificate Request
Sign Certificate for Slave
Copy CA Certificate to Servers
Modify Certificate Permissions
Configure SSL on Master and Slave
Re‑check SSL Status
Set Replication User to Require SSL
Slave Login Test
Error Handling
The slave reported Slave_IO_Running = NO , indicating startup failure. The error details are shown in the following screenshots.
Solution
The End
The SSL‑based MySQL/MariaDB master‑slave replication experiment concludes here. Encountered issues can be resolved with patience, and the secure replication setup will function reliably.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
