Installing Percona Server on Debian and Ubuntu¶
Ready-to-use packages are available from the Percona Server software repositories and the download page.
Specific information on the supported platforms, products, and versions is described in Percona Software and Platform Lifecycle.
What’s in each DEB package?¶
percona-server-server-5.7 package contains the database server itself, the
mysqld binary and associated files.
percona-server-common-5.7 package contains files common to the server and client.
percona-server-client-5.7 package contains the command line client.
percona-server-5.7-dbg package contains debug symbols for the server.
percona-server-test-5.7 package contains the database test suite.
percona-server-source-5.7 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
GnuPG, the GNU Privacy Guard:
$ sudo apt-get install gnupg2
Fetch the repository packages from Percona web:
$ wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
Install the downloaded package with dpkg. To do that, run the following commands as root or with sudo:
$ sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
Remember to update the local cache:
$ sudo apt-get update
Once you install this package the Percona repositories should be added. You can check the repository setup in the
After that you can install the server package:
$ sudo apt-get install percona-server-server-5.7
The Percona Server distribution contains several useful User Defined Functions (UDF) from Percona Toolkit. After the installation completes, run the following commands to create these functions:
mysql -e "CREATE FUNCTION fnvla_64 RETURNS INTEGER SONAME 'libfnvla_udf.so'" mysql -e "CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so'" mysql -e "CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so'"
For more details on the UDFs, see Percona Toolkit UDFS.
apt Testing repository¶
Percona offers pre-release builds from the testing repository. To enable it, run
percona-release with the
testing argument. Run this command as root or by using the sudo command.
$ sudo percona-release enable original testing
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.
Installing Percona Server using downloaded deb packages¶
Download the packages of the desired series for your architecture from the download page. The easiest way is to download bundle which contains all the packages. Following example will download Percona Server
5.7.10-3 release packages for Debian 8.0:
$ wget https://www.percona.com/downloads/Percona-Server-5.7/Percona-Server-5.7.10-3/binary/debian/jessie/x86_64/Percona-Server-5.7.10-3-r63dafaf-jessie-x86_64-bundle.tar
You should then unpack the bundle to get the packages:
$ tar xvf Percona-Server-5.7.10-3-r63dafaf-jessie-x86_64-bundle.tar
After you unpack the bundle you should see the following packages:
$ ls *.deb libperconaserverclient20-dev_5.7.10-3-1.jessie_amd64.deb libperconaserverclient20_5.7.10-3-1.jessie_amd64.deb percona-server-5.7-dbg_5.7.10-3-1.jessie_amd64.deb percona-server-client-5.7_5.7.10-3-1.jessie_amd64.deb percona-server-common-5.7_5.7.10-3-1.jessie_amd64.deb percona-server-server-5.7_5.7.10-3-1.jessie_amd64.deb percona-server-source-5.7_5.7.10-3-1.jessie_amd64.deb percona-server-test-5.7_5.7.10-3-1.jessie_amd64.deb percona-server-tokudb-5.7_5.7.10-3-1.jessie_amd64.deb
Now you can install Percona Server by running:
$ sudo dpkg -i *.deb
This will install all the packages from the bundle. Another option is to download/specify only the packages you need for running Percona Server installation (
percona-server-server-5.7_5.7.10-3-1.jessie_amd64.deb. Optionally you can install
percona-server-tokudb-5.7_5.7.10-3-1.jessie_amd64.deb if you want TokuDB storage engine).
When installing packages manually like this, you’ll need to make sure to resolve all the dependencies and install missing packages yourself. Following packages will need to be installed before you can manually install Percona Server:
The following table lists the default locations for files:
Debian and Ubuntu installation does not 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 must create the user manually.
Running Percona Server¶
The following procedure runs the Percona Server:
Starting the service
Percona Server starts automatically after installation unless the server encounters errors during the installation process. You can also manually start it by running the following command:
$ sudo service mysql start
Confirming the service is running
You can verify the service status by running the following command:
$ service mysql status
Stopping the service
You can stop the service by running the following command:
$ sudo service mysql stop
Restarting the service
You can restart the service by running the following command:
$ sudo service mysql restart
Debian 8.0 (jessie) 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*