• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Input Upgrade your MariaDB

Edward Dekker

Basic Pleskian
CentOS 7 is shipped with MariaDB. MariaDB 10.x version is a drop-in replacement for MySQL 5.5-5.7.
Open the SSH terminal by the root user and/or sudo with your username if you have rights to upgrade:
Code:
Domain / IP adress : Portnumber : Username & Password

Create a backup of all databases with the following command:
Code:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin --all-databases --routines --triggers > /tmp/all-databases.sql

Copy a databases directory in a separate folder like this (for backup purposes also):
Code:
 cp -a /var/lib/mysql/ /var/lib/mysql_backup

Add Yum packages:
Code:
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash

Update your CentOS 7 installation by Yum:
Code:
yum -Y Update

Check the Status of MariaDB:
Code:
service mariadb status

Start the MariaDB service:
Code:
service mariadb start

Upgrade the databases:
Code:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
Restart mysql service:
Code:
service mariadb restart

Execute this command to update the package version inside Plesk:
Code:
plesk sbin packagemng -sdf

Note: After an upgrade to 10.1 version, there may appear 'mysql' init script. It can be removed:
Code:
rm /etc/init.d/mysql
systemctl daemon-reload

Check your status for a last time to confirm the upgrade:
Code:
 service mariadb status

Check tables and auto-fix your databases by your server.
Code:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqlcheck --all-databases --analyze --auto-repair --verbose -u admin
Create an event at Plesk to upgrade your databases by a new releasenumber of the database server and restart atomatic, and check MariaDB server for faults.
 
Last edited:
Copy a databases directory in a separate folder like this (for backup purposes also):
Code:
 cp -a /var/lib/mysql/ /var/lib/mysql_backup

Doing this while the sql server is still running will NOT produce a usable backup because much of the server's current state will be in RAM only. You need to stop mariadb first so the database files are in a consistent state and all pending changes are written to disk:
Code:
service mariadb stop ; cp -a /var/lib/mysql/ /var/lib/mysql_backup ; service mariadb start
 
Back
Top