Installing Percona Server on Debian and Ubuntu¶
Ready-to-use packages are available from the Percona Server software repositories and the download page.
- 9.0 (stretch)
- 16.04LTS (xenial)
- 17.04 (zesty)
- 18.04 (bionic)
- x86_64 (also known as
What’s in each DEB package?¶
percona-server-server package contains the database server itself, the
mysqld binary and associated files.
percona-server-common package contains files common to the server and client.
percona-server-client package contains the command line client.
percona-server-dbg package contains debug symbols for the server.
percona-server-test package contains the database test suite.
percona-server-source package contains the server source.
libperconaserverclient20-dev package contains header files needed to compile software to use the client library.
libperconaserverclient20 package contains the client shared library. The
18.1 is a reference to the version of the shared library. The version is incremented when there is a ABI change that requires software using the client library to be recompiled or its source code modified.
Installing Percona Server from Percona
Fetch the repository packages from Percona web:
wget https://repo.percona.com/apt/percona-release_0.1-8.$(lsb_release -sc)_all.deb
Install the downloaded package with dpkg. To do that, run the following commands as root or with sudo:
dpkg -i percona-release_0.1-8.$(lsb_release -sc)_all.deb
Once you install this package the Percona repositories should be added. You can check the repository setup in the
Enable the repository:
$ sudo percona-release enable ps-80 testing
Remember to update the local cache:
$ sudo apt-get update
After that you can install the server package:
$ sudo apt-get install percona-server
Apt-Pinning the packages¶
In some cases you might need to “pin” the selected packages to avoid the upgrades from the distribution repositories. You’ll need to make a new file
/etc/apt/preferences.d/00percona.pref and add the following lines in it:
Package: * Pin: release o=Percona Development Team Pin-Priority: 1001
For more information about the pinning you can check the official debian wiki.
Running Percona Server¶
Percona Server stores the data files in
/var/lib/mysql/ by default. You can find the configuration file that is used to manage Percona Server in
Debian and Ubuntu installation doesn’t automatically create a special
debian-sys-maint user which can be used by the control scripts to control the Percona Server
mysqld_safe services like it was the case with previous Percona Server versions. If you still require this user you’ll need to create it manually.
Starting the service
Percona Server is started automatically after it gets installed unless it encounters errors during the installation process. You can also manually start it by running:
$ sudo service mysql start
Confirming that service is running
You can check the service status by running:
$ service mysql status
Stopping the service
You can stop the service by running:
$ sudo service mysql stop
Restarting the service
You can restart the service by running:
$ sudo service mysql restart
Debian 9.0 (stretch) and Ubuntu 16.04 (xenial) come with systemd as the default system and service manager so you can invoke all the above commands with
sytemctl instead of
service. Currently both are supported.
Uninstalling Percona Server¶
To uninstall Percona Server you’ll need to remove all the installed packages. Removing packages with apt-get remove will leave the configuration and data files. Removing the packages with apt-get purge will remove all the packages with configuration files and data files (all the databases). Depending on your needs you can choose which command better suits you.
Stop the Percona Server service
$ sudo service mysql stop
Remove the packages
- Remove the packages. This will leave the data files (databases, tables, logs, configuration, etc.) behind. In case you don’t need them you’ll need to remove them manually.
$ sudo apt-get remove percona-server*
- Purge the packages. NOTE: This will remove all the packages and delete all the data files (databases, tables, logs, etc.)
$ sudo apt-get purge percona-server*