How to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.X on Linux Plesk? Database

Several parameters have defaults that differ from the previous versions and the mail reason for these changes to provide better out-of-box performance and to eliminate the need for the database administrator to change settings manually. Upgrades also give you access to new enhancements made in the newer versions.

Following are the instructions for upgrading MySQL 5.5 to 5.6/5.7 and MariaDB 5.5 to 10.0/10.1/10.2/10.3/10.4/10.5 on Linux Plesk.

# plesk version | grep “OS version”

Or

# cat /etc/*-release

Plesk on CentOS 8

CentOS 8 is shipped with MariaDB 10.3 as a default DB.

For security and backup reasons, create a database dump of all databases with the following command:

# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin –verbose –all-databases –routines –triggers > /tmp/all-databases.sql

Stop MariaDB

# servicemariadb stop

Remove additional package conflicting with 10.4 version:

# yum remove mariadb-gssapi-server

Copy the database directory in a separate folder:

# cp -v -a /var/lib/mysql/ /var/lib/mysql_backup

Configure MariaDB repository:

Open the Setting MariaDB repositories page, select your OS distro, release, and desired MariaDB version. Once done, the configuration that should be added to the /etc/yum.repos.d/MariaDB.repo file will appear.

Warning: MariaDB 10.4 and 10.5 are supported since 18.0.30, make sure the latest Plesk version is installed.

Here is an example for MariaDB 10.4:

Open/create the MariaDB.repo file in any text editor.

# vi /etc/yum.repos.d/MariaDB.repo

Add the content below to the file:

[mariadb]

name = MariaDB

baseurl = http://yum.mariadb.org/10.4/centos8-amd64

gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

gpgcheck=1

priority=1

module_hotfixes=1

The configuration item module_hotfixes=1 is a workaround for what MariaDB told is a dnf bug. See MDEV-20673 for more details

Save the changes and close the file.

Reset all the cache:

# yum clean all

Start an upgrade of MariaDB to 10.4:

# yum install MariaDB-server galera-4 MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common

Once the upgrade is finished, start MariaDB:

# systemctl restart mariadb

Upgrade MySQL databases:

# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin

Restart mariadb service:

# systemctl restart mariadb

The following command updates the package version inside Plesk

# plesksbinpackagemng -sdf

Restore SeLinux context:

# restorecon -v /var/lib/mysql/*

At Velan, our server support engineers can help you with upgrade of your database versions on your server. We troubleshoot problems like these for our clients every day. If you are interested in our service, please fill the Quick connect form to get in touch with us.

Credentials

123

Quick Connect With Us

captcha reload