• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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