Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Linux Distributions»CentOS»How to Replace MySQL with MariaDB in CentOS/RHEL

    How to Replace MySQL with MariaDB in CentOS/RHEL

    jason.sotoBy 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.

    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
    Previous ArticleS3cmd – Sync Files Between S3 bucket and Local Directory
    Next Article How to Send Email via SMTP Server from Linux Command Line (with SSMTP)

    Related Posts

    How To Install Linux, Nginx, MySQL, & PHP (LEMP Stack) on Ubuntu 22.04

    Updated:April 7, 20227 Mins Read

    How To Install MySQL Server on Ubuntu 22.04

    Updated:April 6, 20224 Mins Read

    How To Install LAMP Stack on Ubuntu 22.04 LTS

    Updated:April 20, 20225 Mins Read

    How To Install MariaDB on Debian 11

    4 Mins Read

    How to Rename MySQL Database

    Updated:July 26, 20213 Mins Read

    How To Change MySQL User Password

    2 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    • (Resolved) Please install all available updates for your release before upgrading
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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