Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Linux Distributions»CentOS»How to Replace MySQL with MariaDB in CentOS/RHEL

    How to Replace MySQL with MariaDB in CentOS/RHEL

    By jason.sotoApril 5, 20142 Mins Read

    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.

    Advertisement

    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
    

    centos mariadb MySQL replace upgrade
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    (Resolved) MySQL connection error: certificate verify failed

    How to Connect Python with MySQL Database

    Installing MySQL 8.0 on Amazon Linux 2

    How To Install MySQL 8 on Amazon Linux 2

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to Split Large Archives in Linux using the Command Line
    • System.out.println() Method in Java: A Beginner’s Guide
    • Split Command in Linux With Examples (Split Large Files)
    • Test Your Internet Speed from the Linux Terminal
    • 11 Practical Example of cat Command in Linux
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.