How to Install Percona server for MySQL 8.0 on Ubuntu 22.04|20.04|18.04?. Percona Server for MySQL is a free and open source distribution of the MySQL relational database management system created by Percona. It is a fully compatible drop-in replacement for Oracle MySQL. In this guide, we will look at how to install and configure Percona MySQL Server 8.0 on Ubuntu 22.04|20.04|18.04.
For RHEL / CentOS 8: How To Install Percona MySQL Server 8 on CentOS 8 / RHEL 8
If you want to use MySQL / MariaDB database server, then check the following guides instead.
A detailed feature comparison for MySQL and Percona Server for MySQL is available on this link. Below are the steps to install Percona Server for MySQL on Ubuntu and Debian Linux distributions.
Step 1: Add Percona repository
Download repository packages from Percona.
sudo apt update
sudo apt install wget
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
Then Install the downloaded package with dpkg.
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
The command above will add the repository file to /etc/apt/sources.list.d/percona-release.list
Step 2: Install Percona Server for MySQL 8.0
Enable the repository:
$ sudo percona-release setup ps80
* Disabling all Percona Repositories
* Enabling the Percona Server 8.0 repository
* Enabling the Percona Tools repository
Get:1 http://repo.mysql.com/apt/ubuntu focal InRelease [12.2 kB]
Get:2 http://repo.percona.com/prel/apt focal InRelease [9779 B]
Get:3 http://repo.percona.com/ps-80/apt focal InRelease [15.8 kB]
Get:4 http://repo.percona.com/tools/apt focal InRelease [15.8 kB]
Get:5 http://repo.mysql.com/apt/ubuntu focal/mysql-8.0 Sources [963 B]
Get:6 http://repo.mysql.com/apt/ubuntu focal/mysql-apt-config amd64 Packages [566 B]
Get:7 http://repo.mysql.com/apt/ubuntu focal/mysql-8.0 amd64 Packages [6026 B]
Get:8 http://repo.mysql.com/apt/ubuntu focal/mysql-tools amd64 Packages [6426 B]
Get:9 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:10 http://nova.clouds.archive.ubuntu.com/ubuntu focal InRelease
Get:11 http://repo.percona.com/prel/apt focal/main amd64 Packages [750 B]
Get:12 http://nova.clouds.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:13 http://nova.clouds.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:14 http://repo.percona.com/ps-80/apt focal/main Sources [1999 B]
Get:15 http://repo.percona.com/ps-80/apt focal/main amd64 Packages [27.6 kB]
Get:16 http://repo.percona.com/tools/apt focal/main Sources [7579 B]
Get:17 http://repo.percona.com/tools/apt focal/main amd64 Packages [20.2 kB]
Fetched 454 kB in 1s (677 kB/s)
Reading package lists... Done
After enabling the repository, install Percona Server for MySQL 8.0
sudo apt install percona-server-server
Provide root password and set Select default authentication plugin when prompted. Wait for the installation to finish then login to MySQL shell.
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.13-3 Percona Server (GPL), Release '3', Revision 'a920dd6'
Copyright (c) 2009-2018 Percona LLC and/or its affiliates
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 8.0.13-3 |
+-----------+
1 row in set (0.00 sec)
mysql> QUIT;
Percona Server for MySQL 5.7 can be installed by running:
$ sudo percona-release setup ps57
* Disabling all Percona Repositories
* Enabling the Percona Server 5.7 repository
* Enabling the Percona XtraBackup 2.4 repository
Hit:1 http://repo.mysql.com/apt/ubuntu focal InRelease
Hit:2 http://repo.percona.com/prel/apt focal InRelease
Get:3 http://repo.percona.com/ps-57/apt focal InRelease [9809 B]
Get:4 http://repo.percona.com/pxb-24/apt focal InRelease [9779 B]
Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:6 http://nova.clouds.archive.ubuntu.com/ubuntu focal InRelease
Hit:7 http://nova.clouds.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:8 http://nova.clouds.archive.ubuntu.com/ubuntu focal-backports InRelease
Get:9 http://repo.percona.com/ps-57/apt focal/main Sources [2461 B]
Get:10 http://repo.percona.com/ps-57/apt focal/main amd64 Packages [19.6 kB]
Get:11 http://repo.percona.com/pxb-24/apt focal/main Sources [1828 B]
Get:12 http://repo.percona.com/pxb-24/apt focal/main amd64 Packages [2731 B]
Fetched 46.2 kB in 1s (48.7 kB/s)
Reading package lists... Done
$ sudo apt install percona-server-server-5.7
Percona Server for MySQL 8.0 comes with the TokuDB storage engine and MyRocks storage engines. These storage engines are installed as plugins. See Percona MyRocks Installation Guide.
Step 3: Install Desktop Database Management Tool (Optional)
If working with MySQL command line is not your thing, then consider installing a Database Tool to help you. Check out our guide below:
Udemy Video Courses to Learn MySQL Database:
- The Ultimate MySQL Bootcamp: Go from SQL Beginner to Expert
- SQL – MySQL for Data Analytics and Business Intelligence
- MySQL, SQL and Stored Procedures from Beginner to Advanced
- SQL for Beginners: Learn SQL using MySQL and Database Design
- The Complete MySQL Developer Course
- MySQL Database Administration: Beginner SQL Database Design
- Learn Database Design with MySQL
Also read:
How to Install and use Percona Toolkit on Ubuntu
Monitoring MySQL and MongoDB with Prometheus and Grafana – PMM