This blog post serves as a work-log detailing the process of uninstalling and installing a specific version of Percona MySQL Server on CentOS. The post includes instructions for installation using yum utility.
Demo video for uninstall / installing Percona Server for MySQL on CentOS
Uninstall Percona Server for MySQL
Prior to uninstalling, it is recommended to create a backup. Depending on the size of the data, you can choose to use Xtrabackup, mysqldump, or mydumper. Let’s begin by backing up the existing databases, excluding the system databases for now.
mysqldump --single-transaction --routines --triggers --set-gtid-purged=OFF --databases test > test.sql
Save user grants
pt-show-grants > grants.sql
Stop MySQL
systemctl stop mysql
systemctl status mysql
Uninstall Percona Server
[root@ip-172-31-63-168 ~]# yum list installed | grep -i percona
percona-icu-data-files.x86_64 8.0.32-24.1.el7 @ps-80-release-x86_64
percona-release.noarch 1.0-27 @/percona-release-latest.noarch
percona-server-client.x86_64 8.0.32-24.1.el7 @ps-80-release-x86_64
percona-server-server.x86_64 8.0.32-24.1.el7 @ps-80-release-x86_64
percona-server-shared.x86_64 8.0.32-24.1.el7 @ps-80-release-x86_64
percona-server-shared-compat.x86_64 8.0.32-24.1.el7 @ps-80-release-x86_64
percona-toolkit.x86_64 3.5.0-5.el7 @/percona-toolkit-3.5.0-5.el7.x86_64
[root@ip-172-31-63-168 ~]# yum remove percona-server-* percona-toolkit
Remove MySQL specific data-files
[root@ip-172-31-63-168 mysql]# rm -fr /var/lib/mysql/*
Install Percona Server for MySQL
If you don’t have Percona repository already configured and you’re installing this for the first time, you need to configure the repo
sudo yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
sudo percona-release enable-only ps-80 release
Check available packages
[root@ip-172-31-63-168]# yum -q list available --showduplicates Percona-Server-server
percona-server-server.x86_64 8.0.13-3.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.13-4.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.15-5.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.15-6.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.16-7.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.17-8.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.18-9.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.19-10.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.20-11.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.21-12.2.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.22-13.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.23-14.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.25-15.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.26-16.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.26-17.2.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.27-18.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.28-19.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.28-20.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.29-21.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.30-22.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.31-23.1.el7 ps-80-release-x86_64
percona-server-server.x86_64 8.0.32-24.1.el7 ps-80-release-x86_64
Install Specific Version of MySQL
[root@ip-172-31-63-168 mysql]# yum install percona-server-server-8.0.28-19.1.el7
...
=====================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================
Installing:
percona-server-server x86_64 8.0.28-19.1.el7 ps-80-release-x86_64 66 M
Installing for dependencies:
percona-server-client x86_64 8.0.32-24.1.el7 ps-80-release-x86_64 16 M
percona-server-shared x86_64 8.0.32-24.1.el7 ps-80-release-x86_64 1.5 M
percona-server-shared-compat x86_64 8.0.32-24.1.el7 ps-80-release-x86_64 1.2 M
Transaction Summary
=====================================================================================================================================================
Install 1 Package (+3 Dependent packages)
Note that the dependencies are not resolved to the exact version, rather a latest one. So, we will have to specify the exact versions for the same.
yum install percona-server-server-8.0.28-19.1.el7 percona-server-client-8.0.28-19.1.el7 percona-server-shared-8.0.28-19.1.el7 percona-server-shared-compat-8.0.28-19.1.el7