Article directory
In this tutorial will guide you how toCentos 7, upgrade/install MariaDB to the latest MariaDB version.
This tutorial also applies to CWP andVestaCPor any other compatible VPS server control panel.

The latest version of MariaDB is now very stable, and many features have been added and improved in this version.
You canHereCheck the list of all changes.
we have usedWordpress, Joomla, xenforo, IPS Forum and some dependencies that depend onMySQL The DB PHP script checks for the latest MariaDB version, so it is safe to upgrade to this version.
What is MariaDB?
A short description about MariaDB:
- MariaDB is designed toMySQLdirect substitute.
- With more features: new storage engine, fewer bugs and better performance.
- MariaDB was developed by many of MySQL's original developers, who now work for the MariaDB Foundation and MariaDB Corporation, as well as many in the community.
To upgrade, follow these simple steps to upgrade to the latest version.
Step 1: Delete MariaDB old version
- Delete the old version of MariaDB, such as: 5.5 / 10.0 / 10.1 / 10.2 / 10.3
Before installing, it is recommended that you back up firstMySQL database.
First, backup your current my.cnf configuration▼
cp /etc/my.cnf /etc/my.cnf.bak
- Now we need to remove the current version of mariadb 7 installed on centos 5.5:
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 completely removed, but the database will not be removed, don't worry.
For versions above MariaDB 10: 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 completely deleted, but the database will not be deleted, don't worry.
Step 2: Install the latest version of MariaDB
- From MariaDB 5.5 / 10.0 / 10.1 / 10.2 / 10.3 version, install/update to the latest MariaDB version.
Install the latest version of Mariadb from the official repo ▼
yum install nano epel-release -y
Now edit/create the Repo file/etc/yum.repos.d
If there are delete or backup existing repo files, make sure you don't have any other MariaDB repository files ▼
mv /etc/yum.repos.d/mariadb.repo /etc/yum.repos.d/mariadb.repo.bak nano /etc/yum.repos.d/mariadb.repo
Then paste the following, and save▼
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/11.5.1/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
- 11.5.1 is the latest version number at the time of updating this article.
- To obtain the latest version, please visit:
http://yum.mariadb.org/
We will then install the latest version of Mariadb▼
yum clean all yum install MariaDB-server MariaDB-client net-snmp perl-DBD-MySQL -y yum update -y
Recover my.cnf file ▼
rm -rf /etc/my.cnf cp /etc/my.cnf.bak /etc/my.cnf
Then, activate Mariadb to boot, and start the service:
systemctl enable mariadb service mysql start
Step 3: Upgrade the current database
After installation, we need to upgrade the current database by the following command ▼
mysql_upgrade
- If everything goes well, you have successfully upgraded MariaDB 5.5 / 10.0 / 10.1 / 10.2 / 10.3 to the latest version of MariaDB.
If you are typing the command mysql_upgrade When upgrading the database, the following error message appears ▼
[root@ ~]# 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: YES) FATAL ERROR: Upgrade failed
Please use the followingmysql_upgrade command to fix ▼
mysql_upgrade -u root --datadir=/var/lib/mysql/ --basedir=/ --password=123456- Please change the above "123456" to your MySQL or Mariadb database root password.
Finally, you can confirm the MySQL or Mariadb database version by running this command from the terminal SSH ▼
mysql -V
Attention points
If your MariaDB database has a similar error message▼
警告:数据库错误 Column count of mysql.proc is wrong. Expected 21, found 20. Created with MariaDB 50560, now running 100406. Please use mysql_upgrade to fix this error 查询 SHOW FUNCTION STATUSFor solutions to MariaDB database errors, please click the link below to view▼
Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ )'s "How to update/upgrade VestaCP/CWP/CentOS 7 to the latest version of MariaDB?" may be helpful to you.
Welcome to share the link of this article:https://www.chenweiliang.com/cwl-1100.html

