Database management is an essential part of any application. And there are many solutions but some are more business-oriented than others, and today I will show you how to install Percona on CentOS 8. With Percona you will have a professional SQL database manager 100% compatible with MySQL.
Percona and MySQL
Percona Server is a MySQL fork. This makes it 100% compatible with this one, including commands and configurations. In the beginning, it was a community project but today it has a company behind it that offers mainly even more efficiency than MySQL for a lower cost. Percona Server also includes XtraDB which is a fork of the InnoDB engine that makes the application more efficient.
As expected, Percona also has a free version that we can install without problems and is available for Linux.
Thanks to the associated tools of Percona, it is possible to monitor and keep statistics of the performance of the database. On the other hand, Percona also includes in its products an alternative to Galera, which allows us to build our clusters with full compatibility with it.
Install Percona on CentOS 8
As with Debian based distributions Percona makes available a package repository for CentOS 8
So let’s get to work.
First, open a terminal or if you’re going to do the process on a server, connect via SSH.
Once you have the terminal session started, add the repository by downloading and installing an RPM package. You can do all this with the following command:
sudo dnf install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
There you will start the whole process of downloading, installing and adding the repository.
At the end of the process, the repository will be added but it must be enabled. You can do this with the following command:
:~$ sudo percona-release setup ps80 Disabling all Percona Repositories On RedHat 8 systems it is needed to disable dnf mysql module to install Percona-Server Do you want to disable it? [y/N] y Disabling dnf module… Failed to set locale, defaulting to C.UTF-8 Last metadata expiration check: 0:00:48 ago on Sun Mar 8 15:03:41 2020. Dependencies resolved. Package Architecture Version Repository Size Disabling modules: mysql Transaction Summary Complete! dnf mysql module was disabled Enabling the Percona Server 8.0 repository Enabling the Percona Tools repository <*> All done!
As we can notice, enabling the Percona repository disables the MySQL packages module. This avoids any compatibility issues.
Now we can install Percona by executing the following command
:~$ sudo dnf install percona-server-server Failed to set locale, defaulting to C.UTF-8 Percona Server 8.0 release/x86_64 YUM repository 132 kB/s | 1.0 MB 00:08 Percona Server 8.0 release/noarch YUM repository 67 B/s | 257 B 00:03 Percona Tools release/x86_64 YUM repository 110 kB/s | 1.2 MB 00:10 Percona Tools release/noarch YUM repository 120 B/s | 257 B 00:02 Dependencies resolved. Package Architecture Version Repository Size Installing: percona-server-server x86_64 8.0.18-9.1.el8 ps-80-release-x86_64 45 M Installing dependencies: compat-openssl10 x86_64 1:1.0.2o-3.el8 AppStream 1.1 M libaio x86_64 0.3.112-1.el8 BaseOS 33 k make x86_64 1:4.2.1-9.el8 BaseOS 498 k net-tools x86_64 2.0-0.51.20160912git.el8 BaseOS 323 k perl-Carp noarch 1.42-396.el8 BaseOS 30 k perl-Errno x86_64 1.28-416.el8 BaseOS 76 k perl-Exporter noarch 5.72-396.el8 BaseOS 34 k perl-File-Path noarch 2.15-2.el8 BaseOS 38 k perl-IO x86_64 1.38-416.el8 BaseOS 141 k perl-PathTools x86_64 3.74-1.el8 BaseOS 90 k perl-Scalar-List-Utils x86_64 3:1.49-2.el8 BaseOS 68 k perl-Socket x86_64 4:2.027-3.el8 BaseOS 59 k perl-Text-Tabs+Wrap noarch 2013.0523-395.el8 BaseOS 24 k perl-Unicode-Normalize x86_64 1.25-396.el8 BaseOS 82 k perl-constant noarch 1.33-396.el8 BaseOS 25 k perl-interpreter x86_64 4:5.26.3-416.el8 BaseOS 6.3 M perl-libs x86_64 4:5.26.3-416.el8 BaseOS 1.6 M perl-macros x86_64 4:5.26.3-416.el8 BaseOS 72 k perl-parent noarch 1:0.237-1.el8 BaseOS 20 k perl-threads x86_64 1:2.21-2.el8 BaseOS 61 k perl-threads-shared x86_64 1.58-2.el8 BaseOS 48 k percona-server-client x86_64 8.0.18-9.1.el8 ps-80-release-x86_64 12 M percona-server-shared x86_64 8.0.18-9.1.el8 ps-80-release-x86_64 1.3 M percona-server-shared-compat x86_64 8.0.18-9.1.el8 ps-80-release-x86_64 1.2 M Transaction Summary Install 25 Packages Total download size: 70 M Installed size: 479 M Is this ok [y/N]:
Once Percona has been installed, the system service must be started. This process is the same as with MySQL.
:~$ sudo systemctl start mysql
You can then check the operation of the service using this command:
:~$ sudo systemctl status mysql ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since Sun 2020-03-08 15:51:26 EDT; 34s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 10726 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 10808 (mysqld) Status: "Server is operational" Tasks: 40 (limit: 2882) Memory: 326.0M CGroup: /system.slice/mysqld.service └─10808 /usr/sbin/mysqld Mar 08 15:50:53 localhost.localdomain systemd[1]: Starting MySQL Server… Mar 08 15:51:26 localhost.localdomain systemd[1]: Started MySQL Server.
The first thing will be to define a root password but the problem is that during the installation, Percona assigns a temporary password. To find out what it is, use the following command:
:~$ sudo grep 'temporary password' /var/log/mysqld.log 2020-03-08T19:51:02.795737Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: WQ,lRHwtA8pw
And now thanks to the mysql_secure_installation
script, you can change the root password:
:~$ sudo mysql_secure_installation
Now, you can secure the installation:
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y Dropping test database… Success. Removing privileges on test database… Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done!
Finally, you can access to Percona shell.
:~$ sudo mysql -u root -p
Finally, you can check the current version:
:~$ mysql --version mysql Ver 8.0.18-9 for Linux on x86_64 (Percona Server (GPL), Release 9, Revision 53e606f)
So, enjoy it.
Conclusion
Percona server is a professional alternative to MySQL. It has the direct support of a company that promises maximum efficiency and total compatibility with MySQL. Of course, this always benefits the consumer and the more options the better. In this post, you have learned how to install it on CentOS 8.
Please share this post and join our Telegram channel.