• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Replace MySQL with MariaDB in CentOS/RHEL

Written by jason.soto, Updated on April 5, 2014

MariaDB has more features and advantages over MySQL server described here. If you are thinking to switch to MariaDB, this article will help you. Today I am going to show you how to replace MySQL with MariaDB with all you existing Data in Linux CentOS. To do This we are going to follow these steps as root.

Step 1: Backup Existing Databases

Firstly take a backup of all existing databases, In case we need to restore it.

# mysqldump -u root -p --all-databases > BackupDBS.sql

Step 2: Remove MySQL

After confirming that you have all databases backup, Lets remove MySQL from system. Firstly Stop the MySQL Service

# service mysqld stop

We copy the MySQL Configuration File to a Different location to use

# cp /etc/my.cnf /tmp/

Remove all the MySQL Packages

# yum remove mysql*

Step 3: Install MariaDB

To Solve any dependency problem we install the REMI Repo.

# rpm –ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Then install the compat-mysql55 package

# yum –enablerepo=remi-test –disablerepo=remi install compat-mysql55

Now we can proceed with the installation of MariaDB. You can follow the Steps on https://tecadmin.net/install-mariadb-in-centos-rhel-and-fedora/
After we completed these steps we restore our my.cnf we backed up previously to its original location

# cp /tmp/my.cnf /etc/my.cnf

Step 4: Restore All Databases (If Required)

Restore the backup of all our databases in MariaDB server.

# mysql –u root –p < BackupDBS.sql

Finally we restart the service, log back in to MariaDB and check that all our data is indeed all there.

# service mysql restart
# mysql –u –root –p

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Avatar
jason.soto

Leave a Reply Cancel reply

Popular Posts

  • How To Install Python 3.9 on Ubuntu 20.04 5
  • How To Install Python 3.9 on Ubuntu 18.04 0
  • How to Use AppImage on Linux (Beginner Guide) 2
  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy