Applicable to:
- Plesk for Linux
Question
How to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.X on Linux?
Answer
This article provides 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.
Note: 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/.
To find out your Linux distribution, run:
# plesk version | grep "OS version"
Or:
# cat /etc/*-release
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.
Warnings:
Direct upgrade from MySQL 5.1 to MySQL 5.6/5.7 will break tables structure. The instructions for upgrading MySQL from 5.1 to 5.5 on Linux are available here: How to upgrade MySQL from 5.1 to 5.5 on Linux
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.
Note: MySQL will not be upgraded on CentOS/RHEL-based operating systems if it was installed from the Webtatic Yum repository:
# rpm -qa | grep -i mysql
mysql55w-server-5.5.57-1.w6.x86_64
To start an upgrade of MySQL/MariaDB, connect to a server via SSH as root/superuser and follow the instructions for your operating system:
By default, CentOS 8 is shipped with MariaDB 10.3.
-
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
-
Stop MariaDB:
# service mariadb stop
-
Remove additional package conflicting with 10.4 version:
# yum remove mariadb-gssapi-server
-
For security reasons, 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:
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.repo
5.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.
-
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
-
Execute this command to update the package version inside Plesk:
# plesk sbin packagemng -sdf
-
Restore SeLinux context:
# restorecon -v /var/lib/mysql/*
By default, CentOS 7 is shipped with MariaDB 5.5. MariaDB 10.x version is a drop-in replacement for MySQL 5.5-5.7.
Automatic method
Note: The script below is applicable only for upgrading default MariaDB 5.5 to the latest MariaDB version, for other cases apply the steps from the Manual Method section. Make sure Obsidian 18.0.30 or later is installed on the server.
-
Download the attached script and provide it with executable rights:
# wget https://support.plesk.com/hc/en-us/article_attachments/4584125667858/c7-mariadb-10.5-upgrade.sh && chmod +x c7-mariadb-10.5-upgrade.sh
-
Execute the script via CLI:
# ./c7-mariadb-10.5-upgrade.sh
Manual Method
-
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
-
Stop MariaDB:
# service mariadb stop
-
Remove additional
mariadb-bench
package if installed:# rpm -e --nodeps mariadb-bench
-
For security reasons, copy the database directory in a separate folder:
# cp -v -a /var/lib/mysql/ /var/lib/mysql_backup
-
Check if the mysql-server package is already installed:
# rpm -q --whatprovides mysql-server
If it is installed and the command above gives output, remove using the following command:
# rpm -e --nodeps `rpm -q --whatprovides mysql-server`
-
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.5:
6.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.repo
6.2. Add the content below to the file:
CONFIG_TEXT: [mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64
gpgkey = https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=16.3. Save the changes and close the file.
-
Reset all the cache:
# yum clean all
-
Start an upgrade of MariaDB:
# yum install MariaDB-client MariaDB-server MariaDB-compat MariaDB-shared
-
Once the upgrade is finished, start MariaDB:
# systemctl restart mariadb
OR
# systemctl restart mysql
-
Upgrade MySQL databases:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
-
Restart mysql service:
# systemctl restart mariadb
OR
# systemctl restart mysql
-
Execute this command to update the package version inside Plesk:
# plesk sbin packagemng -sdf
Note: After an upgrade, there may appear 'mysql' init script. It should be removed to avoid conflicts with MariaDB service. The same commands can be used to fix already existing conflict:
# systemctl stop mysql; killall mysqld # to stop the incorrect service if it is started
# rm /etc/init.d/mysql && systemctl daemon-reload # to remove the incorrect service script and reload systemctl configuration
# systemctl start mariadb # to start MariaDB if not started
# systemctl enable mariadb # to make sure that MariaDB will start after the server reboot automatically
-
Create a backup 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 the MySQL service:
# service mysqld stop
-
Copy a databases directory in a separate folder like this (for backup purposes also):
# cp -v -a /var/lib/mysql/ /var/lib/mysql_backup
-
Start the MySQL service:
# service mysqld start
-
Ensure that
[mysqlclient]
repository is enabled in/etc/yum.repos.d/cl-mysql.repo
and the below command displays similar output:# yum repolist enabled | grep mysqlclient
Repository extras is listed more than once in the configuration
mysqclient/7/x86_64 mysqlclient 7 -
Select MySQL/MariaDB version to install:
Note: The following command does not work if
governor-mysql
package is not installed. In such case, install it:
# yum install governor-mysql# /usr/share/lve/dbgovernor/mysqlgovernor.py --mysql-version=XXXXX
Note: Where 'XXXXX' has to be substituted with one of the following:
mariadb100
for MariaDB v10.0mariadb101
for MariaDB v10.1mariadb102
for MariaDB v10.2mariadb103
for MariaDB v10.3mariadb104
for MariaDB v10.4mariadb105
for MariaDB v10.5mysql55
for MySQL v5.5mysql56
for MySQL v5.6mysql57
for MySQL v5.7 -
Install selected previously MariaDB engine:
# /usr/share/lve/dbgovernor/mysqlgovernor.py --install
Warning: CloudLinux does not recommend to downgrade from MySQL v5.6, MariaDB 10.x
-
Restart MySQL:
# service mysql restart
-
Upgrade MySQL databases:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
-
Restart MySQL:
# service mysql restart
-
Execute the following commands to update package version inside Plesk:
# plesk bin service_node --update local
# plesk sbin packagemng -sdf
Debian 9 is basically shipped with MariaDB. MariaDB 10.x version is a drop-in replacement for MySQL 5.5/5.6/5.7
- Backup all existing databases using the KB article How to backup/restore a Plesk database dump and follow instructions on MariaDB site to update it:
Example for MariaDB 10.2
-
Install MariaDB:
1.1. Stop the MariaDB service:
# service mariadb stop
# curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=mariadb-10.2
# apt install mariadb-server-10.2If the installation fails with unmet dependencies:
CONFIG_TEXT: dpkg: mariadb-server-10.1: dependency problems, but removing anyway as you requested:
plesk-mysql-server depends on virtual-mysql-server | mysql-server; however:
Package virtual-mysql-server is not installed.
Package mariadb-server-10.1 which provides virtual-mysql-server is to be removed.
Package mariadb-server-10.2 which provides virtual-mysql-server is not installed.
Package mysql-server is not installed.
<...>
The following packages have unmet dependencies:
mariadb-server-10.2 : Depends: mariadb-client-10.2 (>= 10.2.19+maria~stretch) but it is not going to be installed
Depends: mariadb-server-core-10.2 (>= 10.2.19+maria~stretch) but it is not going to be installedRun the command below to correct them:
# apt --fix-broken install
-
Check MySQL version:
# mysql -V
mysql Ver 15.1 Distrib 10.2.19-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2 -
Start the MariaDB service:
# service mariadb start
Note: It may be already started
-
Upgrade MySQL databases:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
-
Restart mysql service:
# service mariadb restart
-
Execute the following commands to update package version inside Plesk:
# plesk bin service_node --update local
# plesk sbin packagemng -sdf
By default, Debian 10 is shipped with MariaDB 10.3.
-
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
-
Stop MariaDB:
# service mariadb stop
Here is an example for MariaDB 10.4:
Warning: MariaDB 10.4 and 10.5 are supported since 18.0.30, make sure the latest Plesk version is installed.
-
Install repositories from Setting up MariaDB Repositories page:
Warning: Check the file "
/etc/apt/sources.list
" and the files inside directory "/etc/apt/sources.list.d/
" and disable (comment with#
at the beginning of the line) all MySQL repositories (e.g. MySQL 8 repository) to avoid installation of wrong MySQL versions by mistake.# apt-get install software-properties-common dirmngr apt-transport-https
# apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
# add-apt-repository 'deb [arch=amd64,arm64,ppc64el] https://mirror.docker.ru/mariadb/repo/10.4/debian buster main'
For other MariaDB versions replace 10.4 with 10.5 in the repository path.
-
Create a backup of all MySQL data:
# cp -v -a /var/lib/mysql/ /var/lib/mysql_backup
-
Start an upgrade with the following command. Leave all fields empty when asked for a 'root' user password:
# apt-get update
# apt-get install mariadb-server
If the installation fails with unmet dependencies:
CONFIG_TEXT: plesk-mysql-server depends on virtual-mysql-server | mysql-server; however:
Package virtual-mysql-server is not installed.
Package mariadb-server-10.3 which provides virtual-mysql-server is to be removed.
Package mysql-server is not installed.
[...]
dpkg: error processing archive /var/cache/apt/archives/mariadb-server-10.4_1%3a10.4.14+maria~buster_amd64.deb (--unpack):
trying to overwrite '/usr/bin/my_print_defaults', which is also in package mariadb-server-core-10.3 1:10.3.22-0+deb10u1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/mariadb-server-10.4_1%3a10.4.14+maria~buster_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)OR
CONFIG_TEXT: The following packages have unmet dependencies:
mariadb-server : Depends: mariadb-server-10.4 (>= 1:10.4.14+maria~buster) but it is not going to be installed
plesk-mysql-server : PreDepends: virtual-mysql-server or
mysql-server but it is not installable
Depends: virtual-mysql-server or
mysql-server but it is not installableRun the command below to correct them:
# apt --fix-broken install
-
Start the MariaDB service:
# service mariadb start
-
Upgrade MySQL databases:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
-
Restart mysql service:
# service mariadb restart
-
Execute the following commands to update package version inside Plesk:
# plesk bin service_node --update local
# plesk sbin packagemng -sdf
Ubuntu 18.04 is shipped with MariaDB 10.1. MariaDB 10.x version is a drop-in replacement for MySQL 5.5-5.7. In order to upgrade MariaDB 10.1 to MariaDB 10.x, follow these steps:
-
Create a backup 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 the MariaDB service:
# service mariadb stop
Here is an example for MariaDB 10.2:
Warning: MariaDB 10.4 and 10.5 are supported since 18.0.30, make sure the latest Plesk version is installed.
-
Install repositories from Setting up MariaDB Repositories page:
Warning: Check the file "/etc/apt/sources.list" and the files inside directory "/etc/apt/sources.list.d/" and disable (comment with # at the beginning of the line) all MySQL repositories (e.g. MySQL 8 repository) to avoid installation of wrong MySQL versions by mistake.
# apt-get install software-properties-common
# apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
# add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mirror.truenetwork.ru/mariadb/repo/10.2/ubuntu bionic main'
For other MariaDB versions replace 10.2 with 10.3, etc. in the repository path.
-
Create a backup of all MySQL data:
# cp -v -a /var/lib/mysql/ /var/lib/mysql_backup
-
Start an upgrade with the following command. Leave all fields empty when asked for a root user password:
# apt-get update
# apt-get install mariadb-server
-
Start the MariaDB service:
# service mariadb start
-
Upgrade MySQL databases:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
-
Restart mysql service:
# service mariadb restart
-
Execute the following commands to update package version inside Plesk:
# plesk bin service_node --update local
# plesk sbin packagemng -sdf
By default, Ubuntu 20.04 is shipped with MariaDB 10.3.
-
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
-
Stop MariaDB:
# service mariadb stop
Here is an example for MariaDB 10.4:
Warning: MariaDB 10.4 and 10.5 are supported since 18.0.30, make sure the latest Plesk version is installed.
-
Install repositories from Setting up MariaDB Repositories page:
Warning: Check the file "
/etc/apt/sources.list
" and the files inside directory "/etc/apt/sources.list.d/
" and disable (comment with#
at the beginning of the line) all MySQL repositories (e.g. MySQL 8 repository) to avoid installation of wrong MySQL versions by mistake.# apt-get install software-properties-common
# apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
# add-apt-repository 'deb [arch=amd64,arm64,ppc64el,s390x] https://mirror.docker.ru/mariadb/repo/10.4/ubuntu focal main'
For other MariaDB versions replace 10.4 with 10.5 in the repository path.
-
Create a backup of all MySQL data:
# cp -v -a /var/lib/mysql/ /var/lib/mysql_backup
-
Start an upgrade with the following command. Leave all fields empty when asked for a 'root' user password:
# apt-get update
# apt-get install mariadb-server
- Adjust the
my.cnf
configuration file to match the new requirements:
# sed -i 's/bind-address = ::ffff:127.0.0.1/bind-address = 127.0.0.1/g' /etc/mysql/my.cnf
-
Start the MariaDB service:
# service mariadb start
-
Upgrade MySQL databases:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
-
Restart mysql service:
# service mariadb restart
-
Execute the following commands to update package version inside Plesk:
# plesk bin service_node --update local
# plesk sbin packagemng -sdf
More information available in MySQL documentation at http://dev.mysql.com/.
Comments
224 comments
Hello @Alexander! Usually, it is not required.
@Artur, in case you need some specific version of MariaDB, you can specify it in repository configuration file in baseurl. For 10.0.27 for CentOS 7 it will be http://yum.mariadb.org/10.0.27/centos7-amd64
@murat,
Such issues required investigation on the server.
Please contact our Support Team for assistance.
Hi @Vinod Vyas,
You need to find the command for a package manager that depends on your server OS. You may search in the internet for the proper command applicable for your OS as it is not managed by Plesk. For example, there are yum and rpm package managers used on Centos, CloudLinux or Red Hat OS and one of available commands would be the following:
# rpm -qa | grep mariadb
Hello @Dinara Aspembitova,
Cool, very fast :-)
@Definedhostinguk this can be only a workaround, not a fix. Check the /var/log/mysqld.log for error messages and search for articles in our Help Center
Hi,
two little things. First, the repo/mirror "mirror.host.ag" in capital city of Bulgaria, Sofia, provided in the tutorial is not accessable since last week. I had to choose another one, because I got the following error [HUB] Plesk Update Manager (PUM) fails: pum is called with arguments.
Second is a question. Is it possible to upgrade from 10.2 to 10.3 or do you recommend to wait a while? Because on the mirrors site shows MariaDB 10.3 release for Ubuntu 18.04 LTS as "stable".
Lots of greets
Update Plesk Onyx 17.8.11 Update Nr. 54 to Mariadb 10.4 from 10.3
If it is installed and the command above gives output, remove using the following command:
# rpm -e --nodeps `rpm -q --whatprovides mysql-server`
Configure MariaDB repository: open the Setting MariaDB repositories page, select your OS distro, release and a desired MariaDB version. Once done, the configuration that should be added to the /etc/yum.repos.d/MariaDB.repo file will appear.
Here is an example for MariaDB 10.2:
6.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.repo
6.2. Add the content below to the file:
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
6.3. Save the changes and close the file.
--> new between the next step in the guide
# yum -y update
# yum install MariaDB-client MariaDB-server
if you receive a conflict with "galera-25.3.26-1" because you had installed mariadb 10.3
# rpm -e galera-25.3.26-1.rhel7.el7.centos.x86_64 ...
# yum install MariaDB-client MariaDB-server
--> Now follow the normal guide...
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
....
# service mariadb restart
Hi @Hopjanj,
Since MariaDB 10.2
default-tmp-storage-engine
(in MySQL calledinternal_tmp_disk_storage_engine
) was changed from MyISAM to InnoDB, which has certain limitations.In general, you may ignore the above warning.
However, to avoid any potential issues with others (not Plesk) databases:
default-tmp-storage-engine
back to MyISAM in[mysqld]
section of/etc/my.cnf
using text editor:# grep default-tmp-storage-engine /etc/my.cnf
default-tmp-storage-engine=MyISAM
# service mariadb restart
is there a possibility to roll back to the previous MariaDB version if any part of the install fails? Im on CentOS 7, MariaDB 5.5.6 and am a little hesitant to go ahead as we have 10+ Wordpress installs on the server
@Ivan,
Thank you for your quick reply.
I will have a look.
HI,
I have installed Obsidian and now some client has problem to import Database (utf8_unicode_520_ci). Your raccomended instruction ist to upgrade MariaDB.Questions:
- can I use with Obsidian and install from Red Hat Softwer Collection the MariaDB10.3?
- can I migrate MariaDB 5.5.64 direct to MariaDB 10.3? On RedHat Manual they raccomand to migrate to Version 10 at first and than to 10.3 https://access.redhat.com/documentation/en-us/red_hat_software_collections/3/html/3.3_release_notes/chap-migration
- can I use your instrution for Cento OS to migrate to MariaDB 10.3
Thanks in advice
I have followed this Article.
Everything went fine but the Mysql version still shows to be 5.5?
What did I do wrong?
Hi!! :)
After upgrade mariaDB (5.5.65 >> 10.2.34) doesn't start with mysqld_safe option :(
Any ideas?
Thanks!
@Vitaly Zhidkov
i have specific it but dont work so does not successfully complete the installation
@Louis-Philippe Frenette
Thank you for sharing the workaround.
It may be useful to another Pleskians.
@Peter Jablonski,
Direct upgrade of MySQL 5.1 to MySQL 5.6/5.7 will damage tables (There is the warning message at the top of this article).
It's strongly recommended to upgrade to MySQL 5.5 at first.
With Ubuntu 14.04 I had to restart mysql before step 7 worked.
Hey there Markus,
1. Looks like not only in Bulgaria the repo http://mirror.host.ag/ is unavailable. We've already replaced it with a different one - http://mirror.truenetwork.ru.
Thanks for bringing this to our attention.
2. MariaDB 10.3 is not yet supported by Plesk. Support for this version will be added in the upcoming major release. It is now reflected in the article as well.
What about this error? upgrading on debian 9 from mariadb 10.1 to 10.2
Any clue how to fix it and continue upgrade?
I am upgrading MariaDB 5.5 to v10.3
What is the command to FIND if any additional packages like mariadb-bench are installed.
Hello,
Mark S. 10.5 should also work fine. The article author will double-check it and add corresponding instructions.
Learning Curve Thank you for the feedback. These points will be also reviewed and we'll look at how to improve the article.
Since message approval takes a long time, I tried to perform the actions I listed above, and some recommended from other sites, by uninstalling mariadb 5.5, just in case.
------------------------------------------------------
mysqldump -u admin -p`cat /etc/psa/.psa.shadow` --all-databases --routines --triggers > ~/backup/all-databases.sql
mysql -uadmin -p`cat /etc/psa/.psa.shadow` -B -e "SET GLOBAL innodb_fast_shutdown=0;"
systemctl stop monit.service
systemctl disable mariadb
systemctl stop mariadb
cp -v -a /var/lib/mysql/ /var/lib/mysql_backup
cp /etc/my.cnf ~/backup/
cp -v -a /etc/my.cnf.d/ ~/backup/
rpm -e --nodeps `rpm -q --whatprovides mariadb-server`
vi /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
yum install MariaDB-server MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common
systemctl enable mariadb
systemctl restart mariadb
mysql_upgrade -uadmin -p`cat /etc/psa/.psa.shadow`
systemctl restart mariadb
plesk sbin packagemng -sdf
mysql -uadmin -p`cat /etc/psa/.psa.shadow` -B -e "SELECT VERSION();"
systemctl restart monit.service
------------------------------------------------------
And... apparently, everything's fine. All the websites are working as before... Good.
@Richard Mountain,
Hello! Please provide me with the output of the following commands:
First of all, thanks for the answer.
If it is not necessary to uninstall the current version of MariaDB (5.5), could I update MariaDB, instead of uninstalling the old version and installing the new one(10.3)?
I understood from some site that it was not recommended, and that it was better to uninstall version 5.5 and then install version 10.3. I don't know if that's true.
If an upgrade were possible, I suppose the steps would be:
-------------------------------------------------
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin --all-databases --routines --triggers > /tmp/all-databases.sql
service mariadb stop
cp -v -a /var/lib/mysql/ /var/lib/mysql_backup
vi /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
yum -y upgrade maria*
systemctl restart mariadb
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
systemctl restart mariadb
plesk sbin packagemng -sdf
-----------------------------------------
Is this all right?
And, although a copy of the databases is made, with the dump and copy of the mysql folder, I am not very clear about the process to recover it in case of disaster. Uninstall MariaDB 10.3, remove the repo file, reinstall the default version of centos, restore mysql folder and then recover the dump? Would this be the right order? Is it necessary to restore the mysql folder or is it enough to recover the dump?
Thank you in advance
Hello Necro
> What is " 'mysql' init script"
This is a leftover from previously installed MySQL server. Init script is a script for a service to start on boot.
> Should i run those final steps anyway?
The last step is required to make sure the processes of old MySQL version are stopped, to start MariaDB if not started, and to make sure that MariaDB will start after the server reboot. I would recommend not avoiding it.
Sid B
> I actually expected it to be available as a module to update/upgrade in the Plesk installer, but it isn't?
A database server is shipped by the OS vendor and Plesk itself does not manage its update/upgrade. Because the upgrade process can involve many pitfalls that only a server administrator would know about.
> Is Plesk going to add MariaDB 10 as a module install or upgrade to the Plesk installer
any time soon?
No information available at the moment. Please monitor Plesk Release Notes to have up-to-date information.
Hello @Jeremy,
Thank you for sharing your user experience.
For further issues feel free to contact Plesk Technical Support.
@Learning Curve, great!
the commands for debian 9 is FAILING, NOT FOUND ERROR.
# curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=mariadb-10.3
-bash: sudo: command not found
curl: (23) Failed writing body (360 != 1369)
Please sign in to leave a comment.