In the world of open-source databases, Percona is a name of repute, known for its high-performance capabilities. This article aims to guide you through the process of installing Percona on Debian 12. Let’s first understand why Percona is a worthy choice for your database management needs.
Why Choose Percona?
Percona Server is an open-source platform that offers an efficient alternative to MySQL. It exhibits advanced features for database management, scalability, and reliability, while ensuring 100% compatibility with MySQL.
Prerequisites for Percona Installation
Before you proceed with the installation, ensure the following:
- Your server is running Debian 12 (Bookworm).
- It’s recommended to use a fresh OS install to prevent any potential issues.
- You have SSH access to the server (or just open Terminal if you’re on a desktop).
- Your server has an active internet connection for downloading necessary packages and dependencies.
- You have a user account with sudo privileges to execute administrative commands.
Step-by-Step Guide to Install Percona on Debian 12 Bookworm
Let’s dive into the step-by-step installation process:
Step 1: Back-Up Existing Databases
If you currently have MySQL or MariaDB running on your server, it’s recommended to back up your databases before installing Percona Server. This will allow you to restore your data if needed.
mysqldump -u root -p --all-databases | gzip > /path/to/all-databases.sql.gz
Replace /path/to/
with a safe location for storing the backup file.
Step 2: Removing Other MySQL Implementations
For a clean install, it’s advisable to uninstall any existing MySQL or MariaDB packages from Debian. This prevents conflicts with Percona Server files and libraries. Use the following apt purge commands:
sudo apt purge mysql* mariadb* sudo apt autoremove
Step 3: Update Your System
Keeping your system up to date is crucial for security and performance. Begin by updating your package list and upgrading existing packages:
sudo apt update sudo apt upgrade
Step 4: Setting Up the Percona Repositories
Percona provides Debian packages through their own apt repository. This needs to be installed and enabled on your system.
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release-sc)_all.deb
Install the release package with dpkg
:
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
Next, enable the ps80 repository for Percona Server 8.0:
sudo percona-release setup ps80
Step 5: Installing Percona on Debian 12
With the repositories configured, you can now install the Percona Server package from the command line:
sudo apt install percona-server-server-8.0
This will download and install the following components:
percona-server-server
– The Percona Server daemon (mysqld)percona-server-client
– Command line client toolspercona-server-common
– Shared components like the shared client librarypercona-server-tokudb
– The TokuDB storage engine for compression
You will be prompted to set a new root password during the installation process. Be sure to pick a strong, secure password you can remember. This password will be used when connecting to Percona as the MySQL root user.
Once the installation finishes, the Percona Server daemon will start automatically. You can test it with:
sudo systemctl status percona-server-server-8.0
Step 6: Configuring Percona Server
After installation, some additional steps help secure and optimize your Percona Server environment.
- Running
mysql_secure_installation
Percona includes a script called mysql_secure_installation
for locking down MySQL installations. It is highly recommended you run this. Connect to the MySQL shell as root:
sudo mysql -u root -p
Then launch the script:
mysql> mysql_secure_installation
This will guide you through important security configurations like:
- Setting a password validation policy
- Removing anonymous user accounts
- Disallowing remote root logins
- Removing unused databases
Follow the prompts to apply the hardening steps.
- Performance Tuning
There are a few key configuration options that can help optimize Percona Server performance:
* **Increase innodb_buffer_pool_size** – This setting controls the memory allocated to cache indexes and data for InnoDB tables. Generally, you’ll want to set this to 60-80% of total system memory. * **Set a dedicated buffer pool instance for redo logs** – Creating a separate 8MB buffer pool just for redo logs can improve write performance substantially:
innodb_buffer_pool_instances=2 innodb_buffer_pool_size=12G # Total minus 8MB innodb_redo_log_buffer_size=8M
* **Adjust the flush method** – In most cases the `O_DIRECT` flush method is ideal. This bypasses the OS cache for increased efficiency.
Percona provides additional tuning advice in their documentation.
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we recommend the Linux SSD VPS services offered by Shape.host. They provide an efficient, scalable, and secure cloud hosting solution, freeing you from the complexities of server management.