Upgrade MariaDB 5.5 to 10.1 on CentOS 7 Plesk Server
EDIT 2022-05: Now Plesk has an easy MySQL upgrade script, to do the upgrade, run
1 2 |
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 ./c7-mariadb-10.5-upgrade.sh |
For more information, see
https://support.plesk.com/hc/en-us/articles/12388091703703
CentOS 7 Plesk Server come with MariaDB 5.5
1 2 3 |
[root@224 ~]# mysql --version mysql Ver 15.1 Distrib 5.5.60-MariaDB, for Linux (x86_64) using readline 5.1 [root@224 ~]# |
The rpm packages installed where
1 2 3 4 5 6 |
[root@224 ~]# rpm -qa | grep -i maria mariadb-libs-5.5.60-1.el7_5.x86_64 sw-mariadb-client-1.0.0-centos7.17031417.x86_64 mariadb-server-5.5.60-1.el7_5.x86_64 mariadb-5.5.60-1.el7_5.x86_64 [root@224 ~]# |
To upgrade MariaDB, first take a backup of all databases.
1 |
mysqldump -u admin -p`cat /etc/psa/.psa.shadow` --all-databases --routines --triggers > /root/all-databases.sql |
Stop MariaDB databases
1 |
service mariadb stop |
Make another backup of data files
1 |
cp -a /var/lib/mysql/ /var/lib/mysql_backup |
Create file
1 |
vi /etc/yum.repos.d/MariaDB.repo |
Add following content
1 2 3 4 5 |
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1/centos7-amd64 gpgkey = https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck = 1 |
Now run
1 |
yum install MariaDB-client MariaDB-server |
This will upgrade your MariaDB 5.5 to MariaDB 10.1
Start MariaDB
1 |
service mariadb start |
At this point, you have newer MariaDB 10.1
1 2 3 |
[root@224 ~]# mysql --version mysql Ver 15.1 Distrib 10.1.36-MariaDB, for Linux (x86_64) using readline 5.1 [root@224 ~]# |
You need to upgrade databases, for this, run
1 |
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin |
Restart MariaDB
1 |
service mariadb restart |
update the package version inside Plesk
1 |
plesk sbin packagemng -sdf |
Remove old MySQL symlink
1 2 |
rm -f /etc/init.d/mysql systemctl daemon-reload |
Back to Plesk