Skip to content
How to Migrate MySQL to MariaDB on CentOS: Step‑by‑Step Guide
Databases 3 min read

How to Migrate MySQL to MariaDB on CentOS: Step‑by‑Step Guide

Learn a concise, five‑step process to safely replace MySQL with MariaDB on a CentOS system—including backup, removal of MySQL packages, downloading and installing MariaDB RPMs, restarting the service, and confirming compatibility with existing tools like phpMyAdmin.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations

1. Backup

First, back up all data to ensure safety. Details of the backup process are omitted.

2. Remove MySQL packages

yum remove mysql-*

Uninstall all MySQL‑related packages.

3. Install MariaDB

mkdir /Download
cd /Download
wget http://yum.mariadb.org/5.5/centos6-amd64/rpms/MariaDB-5.5.33a-centos6-x86_64-client.rpm
wget http://yum.mariadb.org/5.5/centos6-amd64/rpms/MariaDB-5.5.33a-centos6-x86_64-common.rpm
wget http://yum.mariadb.org/5.5/centos6-amd64/rpms/MariaDB-5.5.33a-centos6-x86_64-compat.rpm
wget http://yum.mariadb.org/5.5/centos6-amd64/rpms/MariaDB-5.5.33a-centos6-x86_64-server.rpm
rpm -U MariaDB*

Download the appropriate MariaDB RPMs for your CentOS 6 64‑bit system; other versions are available at http://yum.mariadb.org/.

4. Restart MariaDB

After installation, the service name changes from mysqld (MySQL) to mysql (MariaDB).

chkconfig mysql on
service mysql restart

5. Summary

MariaDB works with the same commands as MySQL, and tools such as phpMyAdmin continue to function. Always back up your data before upgrading.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxMySQLDatabase MigrationCentOSMariaDB
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.