Skip to Content

How to upgrade MariaDB 5.5 to 10.x in CentOS 7 ?

ssh jump server

How to upgrade MariaDB 5.5 to 10. x in CentOS 7 ?

   1. Before upgrading the MariaDB, create a dump of the Ezeelogin database:

root@jumpserver:~# mysqldump db_name > db_name_backup.sql -u root -p

   Example: 

root@jumpserver:~# mysqldump ezlogin_zwpfl > ezlogin_zwpfl_backup.sql -u root -p
Enter password:
root@jumpserver:~#ls
ezlogin_zwpfl_backup.sql

   You can check the current MariaDB version by 

root@jumpserver:~# mysql -V

   Example:

root@jumpserver:~# mysql -V
mysql Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64) using readline 5.1

    To know the list of MariaDB packages before upgradation,

root@jumpserver:~# rpm -qa|grep -i mariadb
mariadb-server-5.5.68-1.el7.x86_64
mariadb-5.5.68-1.el7.x86_64
mariadb-libs-5.5.68-1.el7.x86_64

You can get the Ezeelogin db_name from the /usr/local/etc/ezlogin/ez.conf.

For troubleshooting database-related issues in Ezeelogin 

   2. Stop MariaDB service by the following command:

root@jumpserver:~# systemctl stop mariadb.service

   3. Before upgrading the MariaDB to 10.x, Create the MariaDB.repo file 

root@jumpserver:~# vi /etc/yum.repos.d/MariaDB.repo

   And add the following lines to upgrade MariaDB to 10.4

# MariaDB 10.4 CentOS repository list
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]

name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

   4. Start the upgrade of MariaDB

root@jumpserver:~# yum install MariaDB-client MariaDB-server -y

   5. After it’s finished, start MariaDB:

root@jumpserver:~# systemctl restart mariadb.service

root@jumpserver:~# systemctl enable mariadb.service

   6. Restart MariaDB service:

root@jumpserver:~#systemctl restart mariadb.service

    After upgrading, check the version by,

root@jumpserver:~# mysql -V
mysql Ver 15.1 Distrib 10.4.22-MariaDB, for Linux (x86_64) using readline 5.1

   Also, you can check the list of MariaDB packages after upgradation by,

root@jumpserver:~# rpm -qa|grep -i mariadb
MariaDB-client-10.4.22-1.el7.centos.x86_64
MariaDB-server-10.4.22-1.el7.centos.x86_64
MariaDB-compat-10.4.22-1.el7.centos.x86_64
MariaDB-common-10.4.22-1.el7.centos.x86_64