N.B.: l’upgrade diretto da 5.1 a 5.6/5.7 può danneggiare il sistema. Procedere quindi prima con l’upgrade da 5.1 a 5.5 e successivamente a 5.6/5.7
Versioni supportate:
Plesk Onyx for Linux:
- MySQL 5.1–5.7
- MySQL community edition 5.5, 5.6, 5.7
How to upgrade MySQL from 5.1 to 5.5 on Plesk for Linux
Plesk Installer gets packages from base repositories of an operating system installed.
If MySQL 5.5 is not listed in the base repository, it is not available in Plesk Installer.
In that case, in order to upgrade MySQL version to 5.5, it is needed to configure a third-party repository.
Note: PHP package can also be upgraded during this procedure. Oracle MySQL yum repository is supported only by Plesk Onyx. Also, it is required to have an SSH connection to the server with administrative privileges.
For CentOS/RHEL/CloudLinux systems Atomic repository can be used:
- Install the Atomicorp repository:
# wget -q -O – http://www.atomicorp.com/installers/atomic | sh
- Upgrade MySQL:
# yum upgrade mysql
- In case the message below appears, refer to the KB article Error during yum upgrade: “Packages excluded due to repository protections”:
# yum upgrade mysql
….
881 packages excluded due to repository protections
No Packages marked for Update
- In case the message below appears, refer to the KB article Error during yum upgrade: “Packages excluded due to repository protections”:
- Restart the MySQL service:
# service mysqld restart
- Upgrade MySQL databases:
# mysql_upgrade -uadmin -p`cat /etc/psa/.psa.shadow`
- In case the message below appears, refer to the KB article Error during yum upgrade: Packages excluded due to repository protections:
# yum upgrade mysql
….
881 packages excluded due to repository protections
No Packages marked for Update
How to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.0/10.1/10.2 on Linux
https://support.plesk.com/hc/en-us/articles/213403429-How-to-upgrade-MySQL-5-5-to-5-6#centos7
For CentOS 6:
-
-
- Stop the MySQL service:
# service mysqld stop
- Create a backup of databases:
# cp -a /var/lib/mysql /var/lib/mysql_backup
- Disable Atomic repository, if it is enabled:
# vi /etc/yum.repos.d/atomic.repo
enabled = 0 - Install the MySQL-community repository:
# yum install http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
- Select a MySQL version:
# vi /etc/yum.repos.d/mysql-community.repo
[mysql56-community]
enabled=0
[mysql57-community]
enabled=1 - Install MySQL packages:
# yum update mysql
If update of mysql package ends with
Nothing to domessage, make sure that mysql* packages are not added to excludes inyum.conffile and remove it if it is in the list:# cat /etc/yum.conf | grep exclude
exclude=php-common php-cli php mysql* httpd* mod_ssl* - Type y if this message appears:
warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid : MySQL Release Engineering <mysql-build@oss.oracle.com>
Package: mysql57-community-release-el6-7.noarch (@/mysql57-community-release-el6-7.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Is this ok [y/N]: - Start the MySQL service:
# service mysqld start
If the service does not start, check the following article: MySQL fails to start: mysql.user table is damaged.
- Upgrade MySQL databases:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
- Restart mysql service:
# service mysqld restart
- Stop the MySQL service:
-
For CentOS 7:
CentOS 7 is shipped with MariaDB. MariaDB 10.x version is a drop-in replacement for MySQL 5.5-5.7.
-
-
- Create a backup of all databases with the following command:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin –all-databases –routines –triggers > /tmp/all-databases.sql
- Stop the MariaDB service:
# service mariadb stop
- Remove additional packages like mariadb-bench:
# rpm -e mariadb-bench
- Copy a databases directory in a separate folder like this (for backup purposes also):
# cp -a /var/lib/mysql/ /var/lib/mysql_backup
- Configure MariaDB repository: open the Setting MariaDB repositories page, select OS distro, release and MariaDB version to see the configuration that should be added to /etc/yum.repos.d/MariaDB.repo file. Example for MariaDB10.1:
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey = https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck = 1 - Perform an upgrade with:
# yum install mariadb
- 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 this command to update the package version inside Plesk:
# plesk sbin packagemng -sdf
Note: After an upgrade to 10.1 version, there may appear ‘mysql’ init script. It can be removed:
# rm /etc/init.d/mysql
# systemctl daemon-reload
- Create a backup of all databases with the following command:
-