How To Upgrade MariaDB v5.5 to MariaDB v10.4 on VestaCP CentOS 7.7

DigitalOcean Referral Badge
Start your VPS now with FREE $100 credit.

VestaCP is an open source control panel, lightweight and absolutely free. This control panel is designed to be very lightweight which can work seamlessly with Apache web server + Nginx as a reverse proxy, or Nginx web server + PHP-FPM (PHP FastCGI Process Manager).

VestaCP also supports almost all Linux operating systems, including RHEL / CentOS (5, 6, 7), Debian (7, 8, 9) and Ubuntu (12.04 LTS to 18.10).

Well, in this guide I will show you how to upgrade MariaDB v5.5 to MariaDB v10.4 on your VestaCP server. As we know that VestaCP with CentOS 7+ has been using MariaDB v5.5 for a long time as their default database server.

MariaDB v5.5 is the oldest stable version that is still maintained by MariaDB Corporation AB (formerly SkySQL) to date. On the other hand, this company has released the latest and most up-to-date version of its MariaDB v10.4.

So we need to run our server with MariaDB v10.4 to get the better performance and stability for our server.

Basically upgrading MariaDB on VestaCP is exactly the same as we install MariaDB on a virtual private server without panels.

It’s easy enough to upgrade, we just need to add the custom MariaDB YUM repository on our CentOS server. Please note that to run MariaDB v10 + we need at least 1GB of memory / RAM, and always use the x86_64 (64-bit) system.

Quick tip: Reset MariaDB v10+ root password

1. Upgrade MariaDB v5.5 to MariaDB v10.0

1.) First of all, please log in to your CentOS server via the SSH terminal (you can use PuTTy if you work with Windows on your side) or other software if you are running Linux in front of you. Please note that we need root access to upgrade MariaDB on VestaCP.

READ:  Fixing "failed to start mongod.service: unit mongod.service not found" Error in MongoDB

2.) We need to create a MariaDB.repo file, and then add the custom MariaDB v10.0 YUM repository under the /etc/yum.repos.d/ directory.

$ nano /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.0 CentOS repository list - created 2019-10-22 04:52 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

3.) Remove MariaDB v5.5 from your server.

$ yum remove mariadb-server mariadb-client
$ yum remove mariadb
$ yum autoremove

4.) Install and configure MariaDB v10.0

$ yum clean all
$ yum update (and then please press "NO")
$ yum install MariaDB-server MariaDB-client

5.) Fix & Rename mysqld.log.rpmsave to mysqld.log

$ mv -f /var/log/mariadb/mariadb.log.rpmsave /var/log/mariadb/mariadb.log
$ mkdir /var/run/mariadb/
$ chkconfig mysql on
$ service mysql restart

6.) Run mysql_upgrade

$ mysql_upgrade -u root -p

7.) Configure and secure your MariaDB v10.0 installation.

$ sudo mysql_secure_installation

8.) Now, check your MariaDB database version

$ mysql -V

2. Upgrade MariaDB v10.0 to MariaDB v10.1

Now, after we successfully upgrade MariaDB v5.5 to MariaDB v10.0, we can proceed to the next step to upgrade MariaDB v10.0 to MariaDB v10.1.

1.) Remove the MariaDB 10.1 YUM repository from your MariaDB.repo file. And then paste MariaDB 10.2 YUM repo into your MariaDB.repo file.

$ nano /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.1 CentOS repository list - created 2019-10-22 05:11 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

2.) Remove MariaDB v10.0 from your VestaCP

$ yum remove mariadb-server mariadb-client
$ yum remove mariadb
$ yum autoremove

3.) Install MariaDB v10.1

$ yum clean all
$ yum update (and then please press "NO")
$ yum install MariaDB-server MariaDB-client

4.) Restart your MariaDB v10.1 database server

$ chkconfig mariadb on
$ service mariadb restart

5.) Run mysql_upgrade

$ mysql_upgrade -u root -p

6.) Configure and secure MariaDB

$ sudo mysql_secure_installation

7.) Now, check your MariaDB database version

$ mysql -V

3. Upgrade MariaDB v10.1 to MariaDB v10.2

1.) Remove the current MariaDB 10.1 YUM repository from your MariaDB.repo file. And then paste MariaDB 10.2 YUM repo into your MariaDB.repo file.

$ nano /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.2 CentOS repository list - created 2019-10-22 05:21 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

2.) Remove MariaDB v10.1

$ yum remove mariadb-server mariadb-client
$ yum remove mariadb
$ yum autoremove

3.) Install MariaDB v10.2

$ yum clean all
$ yum update (please press "NO")
$ yum install MariaDB-server MariaDB-client

4.) Restart your MariaDB v10.2 database server

$ chkconfig mariadb on
$ service mariadb restart

5.) Run mysql_upgrade

$ mysql_upgrade -u root -p

6.) Configure and secure your MariaDB installation

$ sudo mysql_secure_installation

7.) Now, check your MariaDB database version

$ mysql -V

4. Upgrade MariaDB v10.2 to MariaDB v10.3

1.) Add the custom MariaDB v10.3 YUM repository to your MariaDB.repo file under the /etc/yum.repos.d/ directory. However, just like the previous step, you need to delete MariaDB 10.2 CentOS repository list from your MariaDB.repo file.

$ nano /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.3 CentOS repository list - created 2019-10-22 05:31 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

2.) Remove MariaDB v10.2 installation from your VestaCP

$ yum remove mariadb-server mariadb-client
$ yum remove mariadb
$ yum autoremove

3.) Install and configure MariaDB v10.3

$ yum clean all
$ yum update (please press "NO")
$ yum install MariaDB-server MariaDB-client

4.) Restart your MariaDB v10.3 database server

$ chkconfig mariadb on
$ service mariadb restart

5.) Run mysql_upgrade

$ mysql_upgrade -u root -p

6.) Configure and secure your MariaDB v10.3 installation

$ sudo mysql_secure_installation

7.) Now, check your MariaDB database version

$ mysql -V

5. Upgrade MariaDB v10.3 to MariaDB v10.4

Upgrade MariaDB 10.4

1.) Just like the previous step, you should delete MariaDB 10.3 repo and then add the custom MariaDB 10.4 YUM repository to your current MariaDB.repo file.

$ nano /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.4 CentOS repository list - created 2019-10-22 05:35 UTC
# 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

2.) Remove MariaDB v10.3 database server

$ yum remove mariadb-server mariadb-client
$ yum remove mariadb
$ yum autoremove

3.) Install and configure MariaDB v10.4

$ yum clean all
$ yum update (please press "NO")
$ yum install MariaDB-server MariaDB-client

4.) Now, let’s restart MariaDB v10.4 database server

$ chkconfig mariadb on
$ service mariadb restart

5.) Run mysql_upgrade command

$ mysql_upgrade -u root -p

6.) Configure and secure your MariaDB v10.3 installation

$ sudo mysql_secure_installation

7.) Now, check your MariaDB database version

$ mysql -V

8.) OK… All DONE!!!

READ:  How To Install Nginx, PHP7.3-FPM and MariaDB 10.3 on Ubuntu 18.04 LTS

Now, your VestaCP server is running with the latest and most up-to-date version of MariaDB v10.4 database server.

Leave a Comment