Upgrading Mysql Version on Linux Plesk Servers

Upgrading Mysql Version on Linux Plesk Servers

We stronly recommend that you back up all your absolute databases before proceeding, as these operations are at the risk of data loss.
For Ubuntu and Debian
1) You should get a full backup ve snapshot on your server.
2) Let’s take the backup of /etc/mysql/my.cnf :
# cp /etc/mysql/my.cnf.ydk
3) Add the MySQL APT Repository (repository)
You can download MySQL APT repository (repository) from here:http://dev.mysql.com/downloads/repo/apt/.
We select and download the platform to be downloaded.
# wget https://dev.mysql.com/get/mysql-apt-config_0.8.9-1_all.deb
We load the downloaded package.
# dpkg -i mysql-apt-config_0.8.9-1_all.deb
During the package installation, you will be prompted to select the version of the MySQL Server and any other components you wish to install. If you are not sure which version to choose, do not change the default options selected for you. You can also choose none if you do not want components to be installed. One you have made the selection for all components, select Apply to configure the version package and complete the installation.
Update MySQL APT repository (repository).
# apt-get update
4) Upgrade Mysql
# apt-get install mysql-server
Allow /etc/mysql/my.cnf update.
5) Ensure that Mysql-community-libs-compat package is installed. If not, you must load it.
6) From Plesk, go to Tools & Settings > Server Components and refresh.
7) Upgrade MySql databases.
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade –uadmin
For Centos 6
1)  Stop Mysql service.
# service mysqld stop
2) Get databases backups.
# cp -a /var/lib/mysql /var/lib/mysql_backup
3) If it is active, bring the Atomic storage to a passive position.
# vi /etc/yum.repos.d/atomic.repo
enabled = 0
4) Upload MySQL-community storage.
# yum install http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
5) Select Mysql version.
# vi /etc/yum.repos.d/mysql-community.repo
[mysql56-community]
enabled=0
[mysql57-community]
enabled=1
6) Upload Mysql packages.
# yum update mysql
7) If the following massage appears, press (y).
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]:
8) Get start Mysql Service.
# service mysqld start
9) Upgrade Mysql databases.
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
10) Restart Mysql.
# service mysqld restart
For Centos 7
1) Back up all our databeses with the following command.
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin –all-databases > /tmp/all-databases.sql
2) Stop MariaDB service.
# service mariadb stop
3) Remove addtional packages like mariadb-bench.
# rpm -e mariadb-bench
4) Copy databeses index to a separate folder. (With the purpose of backup)
# cp -a /var/lib/mysql/ /var/lib/mysql_backup
5) Configure MariaDB repositories: Open Setting MariaDB repositories page, select OS distribution, version and MariaDB version to see the configuration that needs to be added to the /etc/yum.repos.d/MariaDB.repo file. Example : 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
6) Upgrade with the following command .
# yum install mariadb
7) Start MariaDB service.
# service mariadb start
8) Run this command to update the package version in Plesk:
# plesk sbin packagemng -sdf
Note: After upgrading to version 10.1 ‘mysql’ init script file may appear and be deleted.

Leave a Reply

Your email address will not be published. Required fields are marked *