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/10.6 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 later versions 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.
Warning:
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
Warning:
Direct upgrade from MariaDB 5.5 or 5.7 to MariaDB 10.6 or later versions is not possible.
You should first upgrade MariaDB 5.5. or 5.7 to any MariaDB from 10.3 to 10.5, and then perform an update to MariaDB 10.6 or later
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 later versions 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
- In case upgrading to MariaDB 10.6 or newer it is needed to 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/my.cnf
-
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 MariaDB 10.5 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://raw.githubusercontent.com/plesk/kb-scripts/master/c7-mariadb-10-5-upgrade/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 > /root/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 mariadb-server package is already installed:
# rpm -q --whatprovides mariadb-server
If it is installed and the command above gives output, remove using the following command:
# rpm -e --nodeps `rpm -q --whatprovides mariadb-server`
-
Configure MariaDB repository:
Warning: MariaDB 10.4 and later versions are supported since 18.0.30, make sure the latest Plesk version is installed.
Here is an example for MariaDB 10.5:
6.1. The following command adds the MariaDB 10.5 repository:
# curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.5
Note: Make sure that other MariaDB repositories are not enabled in
/etc/yum.repos.d/
. -
Reset all the cache:
# yum clean all
-
Start an upgrade of MariaDB:
# yum install MariaDB-client MariaDB-server MariaDB-compat MariaDB-shared
- In case upgrading to MariaDB 10.6 or newer it is needed to 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/my.cnf
-
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 -f /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 > /root/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
- In case bind-address directive is present in
/etc/my.cnf
make sure that it is as follows :
# bind-address = 127.0.0.1
-
Start the MySQL service:
# service mysqld start
-
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.5mariadb106
for MariaDB v10.6mysql55
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 > /root/all-databases.sql
-
Stop MariaDB:
# service mariadb stop
Here is an example for MariaDB 10.4:
Warning: MariaDB 10.4 and later versions are supported since 18.0.30, make sure the latest Plesk version is installed.
-
Install repositories:
# apt-get install software-properties-common dirmngr apt-transport-https
# apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
# curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.5
-
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:
# systemctl start mariadb.service
-
Upgrade MySQL databases:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
-
Restart mysql service:
# systemctl restart mariadb
-
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 later versions are supported since 18.0.30, make sure the latest Plesk version is installed.
-
Install repositories:
# apt-get install software-properties-common
# apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
# curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.2
-
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:
# systemctl start mariadb
-
Upgrade MySQL databases:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
-
Restart mysql service:
# systemctl restart mariadb
-
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 later versions are supported since 18.0.30, make sure the latest Plesk version is installed.
-
Install repositories:
# apt-get install software-properties-common
# apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
# curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.4
-
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
258 comments
Hi!! :)
After upgrade mariaDB (5.5.65 >> 10.2.34) doesn't start with mysqld_safe option :(
Any ideas?
Thanks!
Learning Curve
Thank you for the feedback
Hello Miguel Ángel
This option by itself shouldn't cause the issue.
If it's still actual, submit a support request.
Possible Bugfix while Upgrading from 10.3 directly to 10.5 on CentOS 8.x.
file /usr/share/mysql/charsets/swe7.xml from install of MariaDB-common-10.5.8-1.el8.x86_64 conflicts with file from package mysql-common-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64
run this command:
sudo rpm -e mysql-common-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 --nodeps
Is it normal that I see the following error message upgrading from 10.3.x to 10.5.x on Ubuntu 20?
dpkg: mariadb-server-10.3: dependency problems, but removing anyway as you requested:
plesk-mysql-server depends on mariadb-server | virtual-mysql-server; however:
Package mariadb-server is not configured yet.
Package virtual-mysql-server is not installed.
Package mariadb-server-10.3 which provides virtual-mysql-server is to be removed.
plesk-mysql-server depends on mariadb-server | virtual-mysql-server; however:
Package mariadb-server is not configured yet.
Package virtual-mysql-server is not installed.
Package mariadb-server-10.3 which provides virtual-mysql-server is to be removed.
plesk-mysql-server depends on mariadb-server | virtual-mysql-server; however:
Package mariadb-server is not configured yet.
Package virtual-mysql-server is not installed.
Package mariadb-server-10.3 which provides virtual-mysql-server is to be removed.
plesk-mysql-server depends on mariadb-server | virtual-mysql-server; however:
Package mariadb-server is not configured yet.
Package virtual-mysql-server is not installed.
Package mariadb-server-10.3 which provides virtual-mysql-server is to be removed.
Why don't you offer a Graphical User Interface for this?
We are using Plesk in the AWS environment. You cannot log in as root, but instead, login as ec2-user then use sudo.
Issue at step 1:
sudo MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin --verbose --all-databases --routines --triggers > /tmp/all-database
cat: /etc/psa/.psa.shadow: Permission denied
-- Connecting to localhost...
mysqldump: Got error: 1045: "Access denied for user 'admin'@'localhost' (using password: NO)" when trying to connect. I did confirm the username is 'admin'
How do I get past the Permission Denied? Thank you.
Hi there,
some changes for CloudLinux:
1. Please add
mariadb103
for MariaDB v10.3mariadb104
for MariaDB v10.42. Please remove:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
This command is not needed. Console say it is already performed and you have to add -force...
Big thank you and have a great day!
Hi,
I am planning to upgrade mariadb to 10.5, below are few outputs,
[##### ssh]# rpm -qa | grep -i mysql
perl-DBD-MySQL-4.023-6.el7.x86_64
plesk-mysql-server-18.0-2.centos.7+p18.0.27.0+t200421.1927.noarch
plesk-php80-mysql-8.0.0-1centos.7.201130.1749.x86_64
plesk-php73-mysql-7.3.25-1centos.7.201126.1815.x86_64
plesk-php74-mysql-7.4.13-1centos.7.201126.1815.x86_64
[######]# rpm -qa | grep mariadb
plesk-libmariadbclient-3.1-3.1.8-1centos.7.200603.1842.x86_64
mariadb-libs-5.5.68-1.el7.x86_64
mariadb-5.5.68-1.el7.x86_64
mariadb-server-5.5.68-1.el7.x86_64
[####### ssh]# cat /etc/*-release
CentOS Linux release 7.9.2009 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
18.0.32.2
Plesk Obsidian 18.0
CentOS Linux release 7.9.2009 (Core)
CentOS Linux release 7.9.2009 (Core)
Is it okay to safely use instructions mentioned above for "Plesk on CentOS 7 / RHEL 7" and upgrade to mariadb 10.5
What about this error? upgrading on debian 9 from mariadb 10.1 to 10.2
Any clue how to fix it and continue upgrade?
Hi Great guys,
I install Mysql in the AWS linux server, it is version mysql Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64) using readline 5.1 (exported by Mysql -V).
But I want upgrade 5.5.68-MariaDB to 10.3+ MarinaDB . In my server has no /etc/psa/.psa.shadow folder and file. I tried to run the commands but there are many error. Could you tell me what I should to do please ? Thank you so much !
error :
---> Package socat.x86_64 0:1.7.3.2-2.amzn2.0.1 will be installed
--> Finished Dependency Resolution
Error: Package: MariaDB-client-10.4.17-1.el8.x86_64 (mariadb)
Requires: libc.so.6(GLIBC_2.28)(64bit)
Error: Package: MariaDB-server-10.4.17-1.el8.x86_64 (mariadb)
Requires: libc.so.6(GLIBC_2.28)(64bit)
Error: Package: MariaDB-shared-10.4.17-1.el8.x86_64 (mariadb)
Requires: libc.so.6(GLIBC_2.28)(64bit)
Error: Package: galera-4-26.4.6-1.el8.x86_64 (mariadb)
Requires: libboost_program_options.so.1.66.0()(64bit)
Error: Package: MariaDB-backup-10.4.17-1.el8.x86_64 (mariadb)
Requires: libc.so.6(GLIBC_2.28)(64bit)
Error: Package: MariaDB-server-10.4.17-1.el8.x86_64 (mariadb)
Requires: libcrypt.so.1(XCRYPT_2.0)(64bit)
Error: Package: MariaDB-backup-10.4.17-1.el8.x86_64 (mariadb)
Requires: libcrypt.so.1(XCRYPT_2.0)(64bit)
Error: Package: MariaDB-client-10.4.17-1.el8.x86_64 (mariadb)
Requires: libcrypt.so.1(XCRYPT_2.0)(64bit)
Error: Package: MariaDB-server-10.4.17-1.el8.x86_64 (mariadb)
Requires: libsepol >= 2.8-2.el8
Installed: libsepol-2.5-8.1.amzn2.0.2.x86_64 (installed)
libsepol = 2.5-8.1.amzn2.0.2
Available: libsepol-2.5-6.amzn2.x86_64 (amzn2-core)
libsepol = 2.5-6.amzn2
Available: libsepol-2.5-8.1.amzn2.i686 (amzn2-core)
libsepol = 2.5-8.1.amzn2
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[
Product version: Plesk Obsidian 18.0.33.0
OS version: CentOS 7.9.2009 x86_64
Build date: 2021/01/23 00:00
Revision: db5d37f7d2a3360673aa3cba5d73bdda02aed535
mysql Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64) using readline 5.1
I was following this guide and it worked for me until step 8.
After:
#systemctl restart mariadb
I'm getting:
Redirecting to /bin/systemctl start mariadb.service
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
Can you help me, please?
Dima Yaremenko Did you check the error messages ? in cat /var/log/messages | grep mariadb
The redirecting is normal it should be named 'mariadb.service' to see all service type # systemctl
Hmm and I notice on my server wdcollect.service failed. Just upgraded mariadb 5.5 to 10.5
Please share some more error message,..
Hello all,
I'm sharing my upgrade path and notes (for anyone that finds it usefull),
upgraded CentOS 7.9.2009 x86_64 Plesk 18.0.32.2 MariaDB 5.5.68-1 to MariaDB 10.5.8-1
As we all should research, backup backup and snap'n'backup :] and read all the comments.
After this I made a bash script step by step mainly to avoid typos, see below and !!! use at your own rist !!!
Requirements:
- create the repo file for the new MariaDB version in /etc/yum.repos.d/MariaDB.repo.disabled
Steps I executed before running the script.
- !!! Plesk Full backup, local and off-site # !!!
- !!! Full (VPS) server backup !!!
- SMTP Server (postfix), stop service ( in Plesk > Tools & Settings > Server Management > Services Management )
- !!! VPS Snapshot !!!
- Suspend sites ( in Plesk > Domains > [tag: Select ALL] > [Change Status .. Suspend]
I tried to upgrade as recommended by Redhat 5.5 > 10.0, it failed, (the repo) could not download so I set it to 10.5 (read below)
Post upgrade notes:
Restart SMTP Server (postfix)
Check # systemctl (For me wdcollect.service failed becouse database connection) manualy restared it.
There is an error in the /var/log/message from wdcollect, think its hardcoded in the (base64-whatever encoded file)
"PHP Warning: date(): We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /usr/local/psa/admin/bin/modules/watchdog/wdcollect on line 194"
As it seemed that the update was succesfull, database started website were running.
A lot of other services where unable to connect in the background to the /var/lib/mysql/mysql.sock
I've restored the connections, services are running but there are still some damaged attributes in the plesk database.
I've removed the script for now.
Hello guys.
I followed all steps on this article onlye and my upgrade was a successful. Thank you for all comments, and observations.
My server is: CentoOS 7.9, with Plesk last version, all updated.
Thanks all people. ;)
Is it just me, or does it seem that updating the now old MariaDB 5.5.68-1 to faster MariaDB 10.5.8-1
(on Centos 7.9 with Plesk Obsidian 18.0.33) is much more convoluted/complicated than it should be?
I actually expected it to be available as a module to update/upgrade in the Plesk installer, but it isn't?
I would like to upgrade Maria on our production server but am hesitant to do so when you see posts like
"I've restored the connections, services are running but there are still some damaged attributes in the plesk database"
from those who have attempted it.
We have the same config as Arno running on a dedicated server
Product version: Plesk Obsidian 18.0.33.0
OS version: CentOS 7.9.2009 x86_64
mysql Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64)
Is Plesk going to add MariaDB 10 as a module install or upgrade to the Plesk installer
any time soon?
Sid B.
Possible Bugfix for startup errors after successful upgrade.
InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.4.18.
mov the "ib_logfile0" to another name than it works.
is stored in /var/lib/mysql/
Thanks!
The automatic method worked fine except Email sending & receiving due to a MariaDB bug #MDEV-24941: SElinux incorrect label for server socket.
Although there is a solution for this here https://support.plesk.com/hc/en-us/articles/360017337699
My system is Plesk Obsidian Version 18.0.35 CentOS 7.9 on Lightsail.
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.
Plesk 'Installer & Updates' lists/includes 6 versions of php, from 5.x to 8. We choose what to install, what not.
The Instller lists/comes with 'standard' MariaDB 5.6. So why not MariaDB 10? Even as an option?
CPanel does it, so I find it hard to believe Plesk can't.
Sid
Sid B,
> The Instller lists/comes with 'standard' MariaDB 5.6. So why not MariaDB 10? Even as an option?
It depends on the particular OS version, as the MariaDB is shipped by the OS vendor, not by Plesk. For example, by default, MariaDB 10.3 is coming with Ubuntu 20 and v10.1 with Ubuntu 18, v 5.5 is shipped with CentOS 7, etc...
Hi there,
my PLESK backend is showing MariaDB 10.5.9 but my server is running 10.5.10. I updatet from 10.5.9 and performed this 2 commands:
#plesk bin service_node --update local
# plesk sbin packagemng -sdf
On CentOS Linux 7.9.2009 and Plesk Obsidian 18.0.37 both Automatic and Manually metohod didn't work.
I need to lunch
yum clean all
to force correct version in new mariadb repo
Serverplan Plesk
What exactly did not work, e.g. what error messages have been displayed? Was "yum clean all" your solution?
I'd like to add this confirmation for CentOS 7.9: Following the steps in the "Plesk on CentOS 7 / RHEL 7" section, the upgrade is correctly executed.
However, here are some add-on suggestions to the instructions:
1) Ensure that innodb_fast_shutdown variable is not 2 or 3. The default of this variable is 1. It can be 1 or 0 for the shutdown, but not higher. The reason for this is that only on 1 or 0 all open transactions are guaranteed to be completed and no redo/undo operations remain. Verify in SQL with
> show variables LIKE 'innodb_fast_shutdown';
Similar issue with innodb_force_recovery. This must be less then 3:
> show variables LIKE 'innodb_force_recovery';
2) I suggest to "service psa stopall" and also to stop dovecot and postfix before stopping MariaDB, because some services might need to access the database to look something up. Imagine a mail is coming in, some service needs to look something up for it in the database and fails so it might discard the mail etc. and we might never know ... The upgrade process on a server with approx. 300 databases only took a few minutes including the data directory backup.
3) Removal of the existing MariaDB-server package is a must. If this step fails, do not proceed.
rpm -e --nodeps `rpm -q --whatprovides mysql-server`
It can fail for example when you are just as unattentive as me in one case when I copied the command from the script file and included the double quotes around the single-quoted rpm command. If the existing MariaDB-server package is not removed, the installation will not install the upgraded MariaDB-server package. Should you run into an issue where only some packages are installed, it is no problem to repeat the installation later for all. Yum will only install the ones that are new or updated.
4) After the upgrade has finished and all seems well, run
# plesk repair db -y
because if you have been using an old version of MariaDB, some field definitions like date and time fields might not be up to date for the Plesk database with the new database scheme.l
Hi on Ubuntu 18.04 bionic... I followed your procedure and had 2 issues :
1) mirror.truenetwork.ru is not responding, I used sfo1.mirrors.digitalocean.com instead (found on mariadb.com)
2) apt-get install gave me : "mariadb-server : Depends: mariadb-server-10.5" "Unable to correct problems, you have held broken packages". I googled and solved this by :
found on stackoverflow.com.
Then after first start of mariadb service I had 2 errors messages, but this was only for the first start before the end of the procedure... finger cross ;-)
I am unable to upgrade from MariaDB 10.1 to 10.2. I get this error:
This is a brief description of the upgrade process. Important details
can be found in the MariaDB manual, in the Upgrading section.
******************************************************************
error: %pre(MariaDB-server-10.2.41-1.el7.centos.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package MariaDB-server-10.2.41-1.el7.centos.x86_64
MariaDB-server-10.1.48-1.el7.centos.x86_64 was supposed to be removed but is not!
Verifying : MariaDB-server-10.1.48-1.el7.centos.x86_64 1/2
Verifying : MariaDB-server-10.2.41-1.el7.centos.x86_64 2/2
Failed:
MariaDB-server.x86_64 0:10.1.48-1.el7.centos MariaDB-server.x86_64 0:10.2.41-1.el7.centos
Complete!
Anyone has any ideas?
Hello Michael,
I have the exact same problem when trying to update MySql (MariaDB).
Unable to remove the old SQL version....
I hope that if you find a solution, you will put it here.
Henk
For the mysqldump command you should add --hex-blob to the parameters.
-hex-blob will dump binary columns using hexadecimal notation.
If you do not do this, then depending on your db contents, if you need to rely on that dump then you may get an error similar to: Mysql ERROR at line 1153: Unknown command '\'
There is an error in the attached script.
This doesn't do anything, the files and directories are copied to /dev/null
echo "creating backup of mysql directory"
cp -v -a /var/lib/mysql/ /var/lib/mysql_backup 2&> /dev/null
It should be something like this, copying the errors to /dev/null
echo "creating backup of mysql directory"
cp -v -a /var/lib/mysql/ /var/lib/mysql_backup 2> /dev/null
Please sign in to leave a comment.