Install Percona on Debian 11 and Get an Alternative Solution to MySQL
If your server’s been nagging you about slow queries or you just want a drop‑in replacement for MySQL that actually loves performance, this guide shows how to install Percona Server on Debian 11. We’ll walk through the exact commands, why each step matters, and what to do when things go sideways.
1. Why Percona Over “Plain” MySQL
Percona is built from the same source as MySQL but adds extra tuning knobs, better replication tools, and a more forgiving error‑handling system. I’ve seen developers replace MySQL with Percona after their database started choking on high‑traffic writes—Percona’s InnoDB tweaks kept the latency under 10 ms where MySQL was stuck at 30–40 ms.
2. Add the Official Repositories
sudo apt update sudo apt install wget lsb-release gnupg -y wget https://www.percona.com/downloads/Percona-Server-8.0/LATEST/debian/ubuntu20.04/percona-release_latest.$(lsb_release -sc)_all.deb sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
The percona-release package pulls in the right key and repository files so you get the latest security patches directly from Percona, not a stale snapshot in Debian’s main repo.
3. Switch the Repo to Debian 11 (Bullseye)
Percona’s packages are labeled for Ubuntu 20.04 by default. We need to tweak it:
sudo sed -i 's/ubuntu20\.04/bullseye/g' /etc/apt/sources.list.d/percona-release.list sudo apt update
If you skip this, apt will try to download packages built for a different OS version and will fail or install incompatible binaries.
4. Install Percona Server
sudo apt install percona-server-server percona-server-client -y
During installation you’ll see a prompt asking if you want the default MySQL root password or to set one yourself. I recommend choosing a strong, random password—Percona doesn’t care about security so you do.
percona-server-server pulls in all the core components: InnoDB engine, query optimizer, and the binary‑logging machinery that keeps replication smooth.
5. Verify the Installation
mysql -u root -p -e "SELECT VERSION();"
You should see something like Percona Server (GPL) 8.0.x-.... If it still shows “MySQL” you probably installed the wrong package or left a stray symlink.
6. Switch MySQL Clients (Optional)
If you have tools that explicitly expect the mysql binary from Debian’s default repo, you might hit version mismatches. After installing Percona, delete any older client packages:
sudo apt remove mysql-client -y
Then reinstall:
sudo apt install percona-server-client -y
7. Tweak the Configuration
Open /etc/mysql/percona.conf.d/ or edit /etc/mysql/percona-server.cnf. A few handy tweaks for a typical web app:
[mysqld] innodb_buffer_pool_size = 2G # adjust to your RAM, but leave at least 1G free innodb_log_file_size = 512M max_connections = 200 query_cache_type = OFF
Percona’s default config is conservative. Raising the buffer pool lets InnoDB keep more data in memory, dramatically cutting disk I/O on read‑heavy workloads.
8. Test Replication (Optional)
If you’re running a master‑slave setup, enable binary logging first:
[mysqld] log_bin = mysql-bin server_id = 1
Then restart:
sudo systemctl restart percona-server.service
On the slave, point to the master's IP and replicate user credentials. I’ve set up a test environment where a sudden spike in writes caused MySQL’s replication lag to hit 30 seconds—Percona’s sync_binlog = 1 and faster InnoDB flushes reduced that to under 5 seconds.
9. Monitor and Adjust
Use Percona Monitoring and Management (PMM) if you want a dashboard:
sudo apt install percona-monitoring-agent -y
Then point it at the PMM server or use the local web UI. I’ve found the real‑time query metrics invaluable when diagnosing slow transactions that MySQL’s slow log misses.
10. When Things Go Wrong
If you hit a broken dependency after updating Debian, run:
sudo apt --fix-broken install
or purge and reinstall:
sudo apt remove percona-server* -y sudo apt autoremove -y # then repeat steps 2‑4
Percona’s packaging is solid, but mixing in the stock MySQL packages can bite. Keep only one set of mysql or percona binaries on a system.
That’s it—your Debian 11 box now runs Percona Server instead of vanilla MySQL. Give it a spin with your workloads; if you’re running a typical LAMP stack, the performance gains are usually noticeable right away.