Installing Percona Server for MySQL on Red Hat Enterprise Linux and CentOS¶
Ready-to-use packages are available from the Percona Server for MySQL software repositories and the download page. The Percona yum repository supports popular RPM-based operating systems, including the Amazon Linux AMI.
The easiest way to install the Percona Yum repository is to install an RPM that configures yum and installs the Percona GPG key.
- CentOS 6 and RHEL 6 (Current Stable)
- CentOS 7 and RHEL 7
- Amazon Linux AMI (works the same as CentOS 6)
- Amazon Linux 2
“Current Stable”: We support only the current stable RHEL6/CentOS6 release, because there is no official (i.e. RedHat provided) method to support or download the latest OpenSSL on RHEL/CentOS versions prior to 6.5. Similarly, and also as a result thereof, there is no official Percona way to support the latest builds of Percona Server for MySQL on RHEL/CentOS versions prior to 6.5. Additionally, many users will need to upgrade to OpenSSL 1.0.1g or later (due to the Heartbleed vulnerability), and this OpenSSL version is not available for download from any official RHEL/Centos repository for versions 6.4 and prior. For any officially unsupported system, src.rpm packages may be used to rebuild Percona Server for MySQL for any environment. Please contact our support service if you require further information on this.
The CentOS repositories should work well with Red Hat Enterprise Linux too, provided that yum is installed on the server.
- CentOS 6 offers an outdated version of the
required by the keyring Vault plugin of Percona Server for MySQL. The version of the
curllibrary in CentOS 6, which depends on the
nsslibrary, is known to create memory corruption issues. This bug is registered in Red Hat Bugzilla. Its current status is CLOSED WONTFIX.
If you intend to use the keyring Vault plugin of Percona Server for MySQL make sure that you use the latest version of the
curllibrary. We recommend that you build it from source configuring with
$ ./configuration --with-ssl --without-nss --prefix=<INSTALATION DIRECTORY>
As soon as you install
curl, make sure that Percona Server for MySQL will use this version.
- How to install curl and libcurl
- x86_64 (also known as
What’s in each RPM package?¶
Each of the Percona Server for MySQL RPM packages have a particular purpose.
|percona-server-server||The server itself (the
|percona-server-debuginfo||Debug symbols for the server|
|percona-server-client||The command line client|
|percona-server-devel||the header files needed to compile software using the client library.|
|percona-server-shared||The client shared library.|
|percona-server-shared-compat||Shared libraries for software compiled against old versions of
the client library. The following libraries are included in
|percona-server-test||package includes the test suite for Percona Server for MySQL.|
Installing Percona Server for MySQL from Percona
lease add sudo to percona-release setup and yum install commands
Run the following commands as root or by using the sudo command
Install the Percona repository
You can install Percona yum repository by running the following command as a
rootuser or with sudo:
$ sudo yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
You should see some output such as the following:
Retrieving http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-latest.noarch.rpm Preparing... ########################################### [100%] 1:percona-release ########################################### [100%]
Enable the repository:
$ sudo percona-release setup ps80
Install the packages
You can now install Percona Server for MySQL by running:
$ sudo yum install percona-server-server
Percona Server for MySQL 8.0 comes with the TokuDB storage engine and MyRocks storage engines. These storage engines are installed as plugins. You can find more information on how to install and enable the TokuDB storage in the TokuDB Installation guide. More information about how to install MyRocks can be found in the section Percona MyRocks Installation Guide.
Percona yum Testing repository¶
Percona offers pre-release builds from our testing repository. To
subscribe to the testing repository, you’ll need to enable the testing
/etc/yum.repos.d/percona-release.repo. To do so,
enabled = 1 (Note that there are 3 sections in this file:
release, testing and experimental - in this case it is the second
section that requires updating). NOTE: You’ll need to install the
Percona repository first (ref above) if this hasn’t been done already.
Installing Percona Server for MySQL using downloaded rpm 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 for MySQL 8.0.13-3 release packages for CentOS 7:
$ wget https://www.percona.com/downloads/Percona-Server-8.0/Percona-Server-8.0.13-3/binary/redhat/7/x86_64/Percona-Server-8.0.13-3-r63dafaf-el7-x86_64-bundle.tar
You should then unpack the bundle to get the packages:
tar xvf Percona-Server-8.0.13-3-r63dafaf-el7-x86_64-bundle.tar
After you unpack the bundle you should see the following packages when running
percona-server-80-debuginfo-8.0.13-3.el7.x86_64.rpm percona-server-client-80-8.0.13-3.el7.x86_64.rpm percona-server-devel-80-8.0.13-3.el7.x86_64.rpm percona-server-server-80-8.0.13-3.el7.x86_64.rpm percona-server-shared-80-8.0.13-3.el7.x86_64.rpm percona-server-shared-compat-80-8.0.13-3.el7.x86_64.rpm percona-server-test-80-8.0.13-3.el7.x86_64.rpm percona-server-tokudb-80-8.0.13-3.el7.x86_64.rpm
Now you can install Percona Server for MySQL 8.0 by running:
$ sudo rpm -ivh percona-server-server-80-8.0.13-3.el7.x86_64.rpm \ percona-server-client-80-8.0.13-3.el7.x86_64.rpm \ percona-server-shared-80-8.0.13-3.el7.x86_64.rpm
This will install only packages required to run the Percona Server for MySQL
8.0. Optionally you can install TokuDB storage engine by
percona-server-tokudb-80-8.0.13-3.el7.x86_64.rpm to the command
above. You can find more information on how to install and enable the TokuDB
storage in the TokuDB Installation guide.
To install all the packages (for debugging, testing, etc.) you should run:
$ sudo rpm -ivh *.rpm
When installing packages manually like this, you’ll need to make sure to resolve all the dependencies and install missing packages yourself.
Running Percona Server for MySQL¶
Percona Server for MySQL stores the data files in
default. You can find the configuration file that is used to manage Percona Server for MySQL in
Starting the service
Percona Server for MySQL is not started automatically on RHEL and CentOS after it gets installed. You should start it by running:
$ sudo service mysql start
Confirming that service is running
You can check the service status by running:
$ sudo 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
RHEL 7 and CentOS 7 come with systemd as the default
system and service manager so you can invoke all the above commands
sytemctl instead of
service. Currently both are
Uninstalling Percona Server for MySQL¶
To completely uninstall Percona Server for MySQL you’ll need to remove all the installed packages and data files.
Stop the Percona Server for MySQL service:
service mysql stop
Remove the packages:
$ sudo yum remove percona-server*
Remove the data and configuration files
rm -rf /var/lib/mysql rm -f /etc/my.cnf
This will remove all the packages and delete all the data files (databases, tables, logs, etc.), you might want to take a backup before doing this in case you need the data.