
This post will show you how to upgrade MariaDB version on CentOS Web Panel installed server.
Reminder: Before start, make sure you backup all databases on the server.
Check your MariaDB version
You can find your MySQL version using the following command;
rpm -qa|grep -i maria
Update your repository files
Open the MariaDB repository file with nano and modify the version with you want to upgrade. For example, if you use 10.2 version, your repository file looks like;
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.2/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
The baseurl line includes the MariaDB version. So, you should change this line. If you want upgrade MariaDB 10.2 to MariaDB 10.5, the repository file should be like this;
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.5/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
Stop and remove old MariaDB service
This commands will not wipe your data.
service mysql stop service mariadb stop systemctl disable mariadb rpm --nodeps -ev MariaDB-server
Install new version of MariaDB
This commands will clean old MariaDB packages and it will install new ones.
yum clean all yum -y update "MariaDB-*" yum -y install MariaDB-server
Upgrade MariaDB
This commands will start your MariaDB service and it will upgrade version.
systemctl enable mariadb service mariadb start mysql_upgrade
After applying all of this commands, you can verify MariaDB version again and you can check your system’s of work. Thats it.