Skip to Content

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

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

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

[email protected]:~# mysqldump db_name > db_name_backup.sql -u root -p

Example: 

[email protected]:~# mysqldump ezlogin_zwpfl > ezlogin_zwpfl_backup.sql -u root -p
Enter password:
[email protected]:~#ls
ezlogin_zwpfl_backup.sql

You can check the current MariaDB version by 

[email protected]:~# mysql -V

Example:

[email protected]:~# 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,

[email protected]:~# 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:

[email protected]:~# systemctl stop mariadb.service

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

[email protected]:~# vi /etc/yum.repos.d/MariaDB.repo

And add 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

[email protected]:~# yum install MariaDB-client MariaDB-server -y

5. After it’s finished, start MariaDB:

[email protected]:~# systemctl restart mariadb.service

[email protected]:~# systemctl enable mariadb.service

6. Restart MariaDB service:

[email protected]:~#systemctl restart mariadb.service

After upgrading, check the version by,

[email protected]:~# 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 upgardation by,

[email protected]:~# 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