Update/Upgrade to MariaDB 10.5/10.4 on VestaCP/CWP/CentOS 8 Stream/CentOS 7

by Sandeep B.

In this tutorial I’ll guide you on how to upgrade/install MariaDB to latest Mariadb10.4 on Centos 7 this tutorial will also work with CWP and VestaCP or any other compatible control panel.

MariaDB 10.4 is now very stable and many features has been added and improved in this version you can check all lists of changes here

I’ve checked MariaDB 10.4 with WordPress, Joomla, xenforo, IPS forum and some more PHP scripts which depends on MySQL DB are working fine with this version hence it is safe to upgrade to this version.

Short description about MariaDB :

MariaDB is designed as a drop-in replacement of MySQL with more features, new storage engines, fewer bugs, and better performance. MariaDB is developed by many of the original developers of MySQL who now work for the MariaDB Foundation and the MariaDB Corporation, and by many people in the community.

To upgrade follow this simple steps to upgrade it to latest version :

Step 1 Remove MariaDB 5.5/10.0/10.1/10.2/10.3

Before installing it is recommended to backup your databases, although it is not necessary if you followed this steps carefully.

First backup your current my.cnf config :

cp /etc/my.cnf /etc/my.cnf.bak

Now we need to remove current version of mariadb 5.5 installed on centos 7 :

For MariaDB 5.5 :

service mariadb stop  /  service mysql stop
rpm -e --nodeps galera
yum remove mariadb mariadb-server

At this point MariaDB 5.5 will be removed completely but the databases are not removed don’t need to worry.

For MariaDB 10.0/10.1/10.2/10.3 :

service mysql stop 
rpm -e --nodeps galera
yum remove MariaDB-server MariaDB-client

At this point MariaDB 10.0/10.1/10.2/10.3 will be removed completely but the databases are not removed don’t need to worry.

Then Install MariaDB 10.4 :

Step 2 Installation/Updating from MariaDB 5.5/10.0/10.1/10.2/10.3 to MariaDB 10.4/10.5

To upgrade Mariadb to 10.4/10.5 in Centos 7 CWP do this :

Install/enable Official repo for mariadb 10.4/10.5:

yum install nano epel-release -y

Now edit/create the Repo file :

Ensure you don’t have any other MariaDB repo file in /etc/yum.repos.d if exists delete or backup the existing repo file :

mv /etc/yum.repos.d/mariadb.repo /etc/yum.repos.d/mariadb.repo.bak
nano /etc/yum.repos.d/mariadb.repo

then paste this lines and save it :
to install Mariadb 10.4

name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64

to install Mariadb 10.5

name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64

After that we’ll install Mariadb 10.4/10.5 what you choose

yum clean all
yum install MariaDB-server MariaDB-client net-snmp perl-DBD-MySQL -y
yum update -y

To upgrade Mariadb 10.4 to 10.5 in Centos 8 CWP do this :

Now edit/create the Repo file :

Ensure you don’t have any other MariaDB repo file in /etc/yum.repos.d if exists delete or backup the existing repo file :

mv /etc/yum.repos.d/mariadb.repo /etc/yum.repos.d/mariadb.repo.bak
nano /etc/yum.repos.d/mariadb.repo

add this lines and save it :

name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos8-amd64

After that update Mariadb 10.4/10.5 what you choose

yum clean all
yum install MariaDB-server MariaDB-client net-snmp perl-DBD-MySQL -y
yum update -y

Step 3

Restore the my.cnf file :

rm -rf /etc/my.cnf
cp /etc/my.cnf.bak /etc/my.cnf

Then enable mariadb to start on boot and start the service :

systemctl enable mariadb
service mysql start

Step 4

After Installation we need to upgrade current databases by this command :


that’s it you’ve successfully upgraded MariaDB 5.5/10.0/10.1/10.2/10.3 to MariaDB 10.4/10.5.

You can confirm the version by running this command from terminal ssh:


Troubleshoot if root login doesn’t work for mysql :

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Go to :

If this post helps you in any way please consider a donation

Donate with PayPal :


You may also like


ryu September 3, 2019 - 2:04 am

rpm -e –nodeps galera
not found not install galera.
how can i install it?
yum install galera ?

Sandy September 4, 2019 - 10:46 pm

rpm -e is for uninstalling the rpm. Galera will auto install from mariadb repository

jay October 31, 2019 - 5:24 pm

Working 100%. thanks for article

moh November 7, 2019 - 9:22 am

thank you for this topic

Josh December 16, 2019 - 1:49 pm

Just be aware that vesta backups cannot be restored to Mariadb 10.4 due to the new authentication schemes. The data will be restored, but the user authentication will not work. I’m still to find the answer…

Sandy December 17, 2019 - 5:46 am

mysql_upgrade ?

Josh December 17, 2019 - 7:26 am

Hi Sandy, no looks like a bug in vesta. I’ve found a workaround and posted it at https://github.com/serghey-rodin/vesta/issues/1962 just waiting for them to roll it in. Good news is that anyone can use it if they patch that file.

Sandy December 17, 2019 - 8:08 am

awesome thanks for the info

Will April 23, 2020 - 5:13 am

Can you please confirm, if it is only old prior to 10.4 backups that can’t be restored or any that vesta does after install of 10.4?

Sandeep B. May 7, 2020 - 3:20 pm

use this version if you need new password hashing and new features else stick with mariadb 10.3 or 10.2

cmgui May 20, 2020 - 4:41 am

Step 3 – If you had previously set a password for root for your previous version Mariadb, mysql_upgrade will yield this error:
[root@server1 log]# mysql_upgrade
Version check failed. Got the following error when calling the ‘mysql’ command line client
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)
FATAL ERROR: Upgrade failed

The solution:
[root@server1 log]# mysql_upgrade -u root -p

After that, I ran mysql_secure_installation

Also did this so you can run mysql as root without having to enter password:
[root@server1 ~]# vi ~/.my.cnf
user = root
password = Password1
user = root
password = Password1
user = root
password = Password1

The step “mysqld –skip-grant-tables –user=mysql &” in https://www.mysterydata.com/how-to-reset-root-password-in-mariadb-10-4-and-mysql-8-0/ does not seem to work. The background process seems to run forever. After running “mysqld –skip-grant-tables –user=mysql &” , cannot start mariadb because there is an existing mysqld running in the background. Had to kill the background process first.

Sandeep B. May 20, 2020 - 6:46 am

Thanks for the steps but not for all this will work, skip grant table option is by far working i already mentioned to kill the process in the post.

Bro September 21, 2020 - 7:52 pm

Hello. With CWP from module = yum_manager I get this error, your guide doesn’t work at the moment either:

Resolving Dependencies
–> Running transaction check
—> Package MariaDB-server.x86_64 0:10.1.45-1.el7.centos will be updated
—> Package MariaDB-server.x86_64 0:10.4.14-1.el7.centos will be an update
–> Finished Dependency Resolution

Dependencies Resolved

Package Arch Version Repository Size
MariaDB-server x86_64 10.4.14-1.el7.centos mariadb 26 M

Transaction Summary
Upgrade 1 Package

Total download size: 26 M
Downloading packages:
No Presto metadata available for mariadb
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction

A MySQL or MariaDB server package (MariaDB-server-10.1.45-1.el7.centos.x86_64) is installed.

Upgrading directly from MySQL 10.1 to MariaDB 10.4 may not
be safe in all cases. A manual dump and restore using mysqldump is
recommended. It is important to review the MariaDB manual’s Upgrading
section for version-specific incompatibilities.

A manual upgrade is required.

– Ensure that you have a complete, working backup of your data and my.cnf
– Shut down the MySQL server cleanly
– Remove the existing MySQL packages. Usually this command will
list the packages you should remove:
rpm -qa | grep -i ‘^mysql-‘

You may choose to use ‘rpm –nodeps -ev ‘ to remove
the package which contains the mysqlclient shared library. The
library will be reinstalled by the MariaDB-shared package.
– Install the new MariaDB packages supplied by MariaDB Foundation
– Ensure that the MariaDB server is started
– Run the ‘mysql_upgrade’ program

This is a brief description of the upgrade process. Important details
can be found in the MariaDB manual, in the Upgrading section.
error: %pre(MariaDB-server-10.4.14-1.el7.centos.x86_64) scriptlet failed, exit status 1
Verifying : MariaDB-server-10.1.45-1.el7.centos.x86_64 1/2
Verifying : MariaDB-server-10.4.14-1.el7.centos.x86_64 2/2

MariaDB-server.x86_64 0:10.1.45-1.el7.centos
MariaDB-server.x86_64 0:10.4.14-1.el7.centos


Bro September 21, 2020 - 7:56 pm

We are applying your tutorial from CWP Simple Terminal. Could this be the problem?

Sandeep B. September 22, 2020 - 6:06 am

use putty ssh client for more stability, and you need to remove previous version of mariadb then install new version.

Bro September 23, 2020 - 10:32 pm

Thanks. We apply your tutorial successfully.

Sandeep B. September 25, 2020 - 10:24 am

perfect :)

hakan October 18, 2020 - 11:20 pm

I installed this version, it is loading too. I could not understand.
How do I restore to 10.1 version please urgently answer?

Sandeep B. October 19, 2020 - 7:50 am

you need to take backup of your databases then stop mariadb and remove it via package manager after that you can go back to minor versions.

Darin December 12, 2020 - 6:42 am

Will this same guide work going from 10.2/10.3/10.4 to the latest release 10.5? Just by setting the base URL to 10.5 instead of 10.4.

Like this?

name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64

Sandeep B. December 12, 2020 - 12:54 pm

yes sure

Darin January 4, 2021 - 8:23 pm

Will any of the Incompatible Changes Between 10.4 and 10.5 listed on MariaDB’s website (link below) going to break CWP or any of my applications after updating?


Sandeep B. January 5, 2021 - 3:03 am

you can safely upgrade to 10.5

Darin January 22, 2021 - 11:06 pm

Upgraded MariaDB to 10.5 and everything appears to be running fine, but on the CWP Panel under Application Version it lists the MySQL Port as “MySQL Remote” instead of “3006”. I double checked with netstat -tlnp that it is in fact running on port 3006, but I’m assuming this is a bug because CWP is looking for msqld and MariaDB switches from “msqld” to “mariadbd”.

Is this correct thinking?

Sandeep B. January 24, 2021 - 3:25 am

“systemctl enable mariadb” to create symlinks of mysql, mysqld and mariadb

Darin January 22, 2021 - 10:50 pm

Why are net-snmp and perl-DBD-MySQL required to be installed with the new MariaDB version when then aren’t installed or removed with default install of MariaDB?

Also you may want to update this for those on CentOS 8.

I found the repo URL directly from MariaDB, but may be helpful for others.


Leave a Comment