Skip to content

How to safely upgrade MySQL with Plesk

woman in blue long sleeve shirt sitting on black chair

This guide shows you how to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.x on Linux with a plesk installation.

The upgrade can be performed in a command-line interface with the instructions below at your own risk. This task is supposed to be performed by a system administrator.
If you are not familiar with Linux system administering and would like our professionals to handle this task on your behalf, contact Professional Services team at https://www.plesk.com/professional-services/.

Warning: MariaDB 10.4 and 10.5 are supported starting from Plesk Obsidian 18.0.30. Previous versions (Onyx and older) do not support MariaDB starting from 10.3 and there are no plans to implement it currently.

It is strongly recommended to create a server snapshot (full backup) before upgrading. Perform MySQL upgrade at your own risk. Before starting a MySQL upgrade, stop the WatchDog service if it is used on a server. Check its status with the service watchdog status command.

Follow the exact steps here

CENTOS 8

By default, CentOS 8 is shipped with MariaDB 10.3.

  1. For security 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
  2. Stop MariaDB:
    # service mariadb stop
  3. Remove additional package conflicting with 10.4 version:
    # yum remove mariadb-gssapi-server
  4. For security reasons, copy the database directory in a separate folder:
    # cp -v -a /var/lib/mysql/ /var/lib/mysql_backup
  5. 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:5.1. Open/create the MariaDB.repo file in any text editor. In this example, we are using the vi editor:
    # vi /etc/yum.repos.d/MariaDB.repo5.2. 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=1The configuration item module_hotfixes=1 is a workaround for what MariaDB told is a dnf bug. See MDEV-20673 for more details5.3. Save the changes and close the file.
  6. Reset all the cache:
    # yum clean all
  7. Start an upgrade of MariaDB to 10.4:
    # yum install MariaDB-server galera-4 MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common
  8. Once the upgrade is finished, start MariaDB:
    # systemctl restart mariadb
  9. Upgrade MySQL databases:
    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
  10. Restart mariadb service:
    # systemctl restart mariadb
  11. Execute this command to update the package version inside Plesk:
    # plesk sbin packagemng -sdf
  12. Restore SeLinux context:
    # restorecon -v /var/lib/mysql/*

Dieser Beitrag hat einen Kommentar

Schreibe einen Kommentar

Deine E-Mail wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

An den Anfang scrollen