If you’re looking to replace your existing MySQL or MariaDB installation with Percona Server for MySQL 8.0, this guide provides a clean and comprehensive installation flow β including optional monitoring with PMM and enabling key UDFs (User Defined Functions) often required in analytics or proxy-based workloads.
Table of Contents
Step 1: Remove Existing MySQL/MariaDB Installations
Before installing Percona Server, it’s best to remove any conflicting installations of MySQL or MariaDB:
sudo apt purge mariadb-* mysql-*
sudo apt autoremove --purge -y
sudo rm -rf /etc/mysql /var/lib/mysql /var/log/mysql*
This completely cleans your system of previous installations and related configurations.
Step 2: Add Percona APT Repository
Download and install the latest Percona APT repository package:
wget https://repo.percona.com/apt/percona-release_latest.generic_all.deb
sudo dpkg -i percona-release_latest.generic_all.deb
Step 3: Setup Repository for Percona Server 8.0
Configure the system to install Percona Server 8.0:
sudo percona-release setup ps80
sudo apt update
Step 4: Install Percona Server
Now install the Percona Server for MySQL:
sudo apt install percona-server-server -y
Enable and start the MySQL service:
sudo systemctl start mysql
sudo systemctl enable mysql
Verify installation:
mysql --version
mysql -u root -p -e "SELECT VERSION();"
Step 5: (Optional) Install Hashing UDFs
Some tools or proxy layers (like MaxScale or ProxySQL) require specific hashing functions. You can enable them as follows:
mysql -u root -p -e "CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so';"
mysql -u root -p -e "CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so';"
mysql -u root -p -e "CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so';"
Check if theyβre active:
mysql -u root -p -e "SELECT * FROM mysql.func;"
Step 6: (Recommended) Install PMM Client for Monitoring
Percona Monitoring and Management (PMM) is an essential tool for real-time performance monitoring and metrics.
To install the PMM 2 client:
sudo percona-release setup pmm2
sudo apt update
sudo apt install pmm2-client
After installation, configure the PMM client to connect to your PMM server using:
pmm-admin config --server-insecure-tls --server-url=https://admin:password@<pmm-server-ip>
pmm-admin add mysql --username=root --password=yourpass