Home WebServer PanelCentOS Web Panel Upgrade the MariaDB version on CentOS Web Panel

Upgrade the MariaDB version on CentOS Web Panel

by Thạch Phạm
Published: Last Updated on
A+A-
Reset

In this article, AZDIGI will guide you to upgrade the MariaDB version on CentOS Web Panel (CWP) most simply.

I. Overview

At the present time, the latest MariaDB version is 10.5, however, when you install CentOS Web Panel (CWP) at present time (November 2020), CentOS Web Panel (CWP) only installs theMariaDB 10.1 only for us.

Upgrading to the latest MariaDB version will have many benefits to mention as follows:

  • Improves the overall stability of MariaDB.
  • Fixed a lot of minor bugs in older versions of MariaDB.
  • Improved performance compared to older versions.
  • Increased security.
  • Support for many new features.

And many more benefits. With so many benefits, we absolutely have many reasons to upgrade the MariaDB CentOS Web Panel version periodically.

To upgrade the MariaDB CentOS Web Panel version, please continue reading the article.

II. Upgrade the MariaDB version on CentOS Web Panel

To upgrade the MariaDB version on CentOS Web Panel, we follow these 2 steps.

Step 1: SSH into your CentOS Web Panel server

To upgrade MariaDB to 10.5 on CentOS Web Panel, we first need to SSH into your VPS/server with root privileges. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:

After successfully SSH, we continue with step 2 to perform the MariaDB version check command.

Step 2: Check the MariaDB version in use

To check the MariaDB version, we have 2 methods as follows.

Method 1: Use the mysqld -V command on the SSH interface.

upgrade-the-mariadb-version-on-centos-web-panel

Method 2: View directly on the CentOS Web Panel interface.

upgrade-the-mariadb-version-on-centos-web-panel

After knowing the version of MariaDB in use, we continue with step 3 to upgrade the MariaDB version on CentOS Web Panel.

Step 3: Upgrade the MariaDB version on CentOS Web Panel

The order to upgrade the MariaDB version on CentOS Web Panel is as follows:

First, you need to backup the my.cnf configuration file with the following command:

AZDIGI Tutorial
cp /etc/my.cnf /etc/my.cnf.bak
    

Next need to uninstall the old MariaDB version from the system with the following commands:

For MariaDB 5.5:

AZDIGI Tutorial
service mariadb stop  hoặc  service mysql stop
yum remove mariadb mariadb-server -y
    

At this point, MariaDB 5.5 will be completely deleted but the database is not deleted so you don’t need to worry.

For MariaDB 10.0/10.1/10.2/10.X:

AZDIGI Tutorial
service mysql stop 
yum remove MariaDB-server MariaDB-client -y
    

At this time, MariaDB 10.0/10.1/10.2 will be completely deleted but the database is not deleted so you don’t need to worry.

In case you want to back up the current data, you can execute the following command:

AZDIGI Tutorial
cp -aR /var/lib/mysql/* /var/lib/mysqlbackup
    

Below is the image after running the uninstall command MariaDB: yum remove mariadb mariadb-server -y.

upgrade-the-mariadb-version-on-centos-web-panel
Uninstall MariaDB.

After the uninstall is complete, we execute the following commands to install the new MariaDB version.

AZDIGI Tutorial
yum install nano epel-release -y
mv /etc/yum.repos.d/mariadb.repo /etc/yum.repos.d/mariadb.repo.bak
vi /etc/yum.repos.d/mariadb.repo
    

After executing the vi /etc/yum.repos.d/mariadb.repo command, we paste the following content:

For CentOS 7:

AZDIGI Tutorial
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
    

For CentOS 8:

AZDIGI Tutorial
[mariadb]
name = MariaDB
baseurl =http://yum.mariadb.org/10.5/centos8-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
    

Then we save and execute the following commands to start the installation process.

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

The installation process takes place relatively quickly, it takes less than 10 minutes to complete.

However this is not done yet, we need to restore the my.cnf configuration file, re-enable MariaDB and update the existing database again with the following commands:

AZDIGI Tutorial
rm -rf /etc/my.cnf
cp /etc/my.cnf.bak /etc/my.cnf
systemctl enable mysql
service mysql start
mysql_upgrade
    

Explanation of the above commands:

  • Command 1: Delete the default configuration file after installing the new MariaDB version.
  • Command 2: Restore the previously backed-up configuration version.
  • Command 3: Enable system startup for MariaDB/MySQL.
  • Command 4: Enable the MariaDB/MySQL service.
  • Command 5: Update the current database.

Please wait a moment for MariaDB to update the data as shown below.

upgrade-the-mariadb-version-on-centos-web-panel
MariaDB updates the current database.

So we have completed upgrading the MariaDB version on CentOS Web Panel. Now everything is back to normal. And you can reuse the mysqld -V command to check the MariaDB version.

upgrade-the-mariadb-version-on-centos-web-panel
The latest version of MariaDB MariaDB 10.5.8 is installed.

III. Summary

So in this article, AZDIGI has shown completely how to upgrade the MariaDB version on CentOS Web Panel. Depending on the case you are using CentOS 7 or CentOS 8 that you use the command correctly.

Hope this article will be of help to you. Wishing you success!

See more useful articles about CentOS Web Panel at the following link:

If you need assistance, you can contact support in the ways below:

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign