Install Percona Server for MySQL on CentOS 8 - CentLinux

Latest

Saturday, 21 November 2020

Install Percona Server for MySQL on CentOS 8

Install Percona Server for MySQL on CentOS 8

Percona Server for MySQL is a distribution of MySQL RDBMS. In this article, you will see how to install Percona server for MySQL on CentOS 8.

 

Table of Contents:

     

    What is Percona Server for MySQL? :

    Percona Server for MySQL is an open source relational database management system (RDBMS) created by Percona. It is a free, fully compatible drop in replacement for Oracle MySQL. The software includes a number of scalability, availability, security and backup features only available in MySQL's commercial Enterprise edition. The software includes XtraDB, an enhanced distribution of the InnoDB Storage Engine.

    The developers aim to retain close compatibility to the official MySQL releases, while focusing on performance and increased visibility into server operations.

    Percona Server for MySQL is distibuted under GNU General Public License (version 2). (Source: Wikipedia)

     

    Features in Percona Server for MySQL:

    Percona Server for MySQL provides following features.

    • Faster and more consistently run queries
    • Enhanced security with binary log (binlog) encryption and data-at-rest encryption
    • Improved efficiency with server consolidation
    • Delayed or completely avoided sharding
    • Better ROI through lower hosting fees and power usage
    • Percona Server for MySQL
    • Cloud-ready support

     

    Environment Specification:

    We are using a minimal CentOS 8 KVM with following specifications.

    • CPU - 3.4 Ghz (2 cores)
    • Memory - 2 GB
    • Storage - 20 GB
    • Operating System - CentOS 8.2
    • Hostname - percona-01.centlinux.com
    • IP Address - 192.168.116.230 /24

     

    Updating Linux Server Packages:

    Connect with percona-01.centlinux.com as root user by using a ssh client.

    It is a good practice to update Linux software packages before installing a new software. We recommend you to upgrade centos 7 to centos 8, if you have not already did so.

    [root@percona-01 ~]# dnf update -y Last metadata expiration check: 0:01:56 ago on Fri 20 Nov 2020 08:22:31 PM PKT. Dependencies resolved. Nothing to do. Complete!

    Packages in our Linux server are already up-to-date.

    Verify the Linux operating system and Kernel version that are being used in this installation guide.

    [root@percona-01 ~]# uname -r 4.18.0-193.28.1.el8_2.x86_64 [root@percona-01 ~]# cat /etc/redhat-release CentOS Linux release 8.2.2004 (Core)

     

    Installing Percona Yum Repository on CentOS 8:

    There are different ways to install Percona Server for MySQL. You can install it by using RPMs, Source Code or Official Yum Repository.

    Since, you are working on CentOS Linux distros, therefore, the most convenient method is to install Percona Server for MySQL from Yum repository.

    Therefore, you need to install Percona yum repository in your Linux server.

    [root@percona-01 ~]# dnf install -y https://repo.percona.com/yum/percona-release-latest.noarch.rpm Last metadata expiration check: 0:11:06 ago on Fri 20 Nov 2020 08:22:31 PM PKT. percona-release-latest.noarch.rpm 11 kB/s | 19 kB 00:01 Dependencies resolved. ================================================================================ Package Architecture Version Repository Size ================================================================================ Installing: percona-release noarch 1.0-25 @commandline 19 k Transaction Summary ================================================================================ Install 1 Package Total size: 19 k Installed size: 31 k Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : percona-release-1.0-25.noarch 1/1 Running scriptlet: percona-release-1.0-25.noarch 1/1 * Enabling the Percona Original repository <*> All done! * Enabling the Percona Release repository <*> All done! The percona-release package now contains a percona-release script that can enable additional repositories for our newer products. For example, to enable the Percona Server 8.0 repository use: percona-release setup ps80 Note: To avoid conflicts with older product versions, the percona-release setup command may disable our original repository for some products. For more information, please visit: https://www.percona.com/doc/percona-repo-config/percona-release.html Verifying : percona-release-1.0-25.noarch 1/1 Installed: percona-release-1.0-25.noarch Complete!

    Percona yum repository also installs percona-release script. This script is used to enable/disable additional yum repositories.

    Execute the following command to enable Percona Server 8.0 repository and disable all other MySQL yum repositories.

    [root@percona-01 ~]# 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... Percona Release release/noarch YUM repository 1.1 kB/s | 1.4 kB 00:01 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!

    Build cache for newly installed yum repositories.

    [root@percona-01 ~]# dnf makecache CentOS-8 - AppStream 3.6 kB/s | 4.3 kB 00:01 CentOS-8 - Base 3.5 kB/s | 3.9 kB 00:01 CentOS-8 - Extras 1.2 kB/s | 1.5 kB 00:01 Percona Release release/noarch YUM repository 4.3 kB/s | 2.9 kB 00:00 Percona Server 8.0 release/x86_64 YUM repositor 4.4 kB/s | 2.9 kB 00:00 Percona Tools release/x86_64 YUM repository 4.1 kB/s | 2.9 kB 00:00 Metadata cache created.

     

    Installing Percona Server for MySQL on CentOS 8:

    You can now install Percona Server for MySQL 8.0 by using dnf command.

    [root@percona-01 ~]# dnf install -y percona-server-server Last metadata expiration check: 0:00:23 ago on Fri 20 Nov 2020 08:36:50 PM PKT. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: percona-server-server x86_64 8.0.21-12.2.el8 ps-80-release-x86_64 48 M Installing dependencies: compat-openssl10 x86_64 1:1.0.2o-3.el8 AppStream 1.1 M make x86_64 1:4.2.1-10.el8 BaseOS 498 k net-tools x86_64 2.0-0.51.20160912git.el8 BaseOS 323 k percona-server-client x86_64 8.0.21-12.2.el8 ps-80-release-x86_64 12 M percona-server-shared x86_64 8.0.21-12.2.el8 ps-80-release-x86_64 1.4 M percona-server-shared-compat x86_64 8.0.21-12.2.el8 ps-80-release-x86_64 1.2 M 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 Transaction Summary ================================================================================ Install 24 Packages Total download size: 73 M Installed size: 377 M Downloading Packages: (1/24): make-4.2.1-10.el8.x86_64.rpm 111 kB/s | 498 kB 00:04 (2/24): perl-Carp-1.42-396.el8.noarch.rpm 71 kB/s | 30 kB 00:00 (3/24): net-tools-2.0-0.51.20160912git.el8.x86_ 57 kB/s | 323 kB 00:05 (4/24): perl-Exporter-5.72-396.el8.noarch.rpm 58 kB/s | 34 kB 00:00 (5/24): perl-File-Path-2.15-2.el8.noarch.rpm 70 kB/s | 38 kB 00:00 (6/24): perl-Errno-1.28-416.el8.x86_64.rpm 25 kB/s | 76 kB 00:03 (7/24): perl-PathTools-3.74-1.el8.x86_64.rpm 83 kB/s | 90 kB 00:01 (8/24): perl-IO-1.38-416.el8.x86_64.rpm 45 kB/s | 141 kB 00:03 (9/24): perl-Scalar-List-Utils-1.49-2.el8.x86_6 56 kB/s | 68 kB 00:01 (10/24): perl-Text-Tabs+Wrap-2013.0523-395.el8. 85 kB/s | 24 kB 00:00 (11/24): perl-Socket-2.027-3.el8.x86_64.rpm 63 kB/s | 59 kB 00:00 (12/24): perl-constant-1.33-396.el8.noarch.rpm 78 kB/s | 25 kB 00:00 (13/24): perl-Unicode-Normalize-1.25-396.el8.x8 108 kB/s | 82 kB 00:00 (14/24): compat-openssl10-1.0.2o-3.el8.x86_64.r 100 kB/s | 1.1 MB 00:11 (15/24): perl-macros-5.26.3-416.el8.x86_64.rpm 123 kB/s | 72 kB 00:00 (16/24): perl-parent-0.237-1.el8.noarch.rpm 68 kB/s | 20 kB 00:00 (17/24): perl-threads-2.21-2.el8.x86_64.rpm 110 kB/s | 61 kB 00:00 (18/24): perl-threads-shared-1.58-2.el8.x86_64. 134 kB/s | 48 kB 00:00 (19/24): perl-libs-5.26.3-416.el8.x86_64.rpm 81 kB/s | 1.6 MB 00:19 (20/24): perl-interpreter-5.26.3-416.el8.x86_64 137 kB/s | 6.3 MB 00:47 (21/24): percona-server-shared-8.0.21-12.2.el8. 59 kB/s | 1.4 MB 00:24 (22/24): percona-server-shared-compat-8.0.21-12 160 kB/s | 1.2 MB 00:07 (23/24): percona-server-client-8.0.21-12.2.el8. 107 kB/s | 12 MB 01:54 (24/24): percona-server-server-8.0.21-12.2.el8. 181 kB/s | 48 MB 04:31 -------------------------------------------------------------------------------- Total 247 kB/s | 73 MB 05:03 warning: /var/cache/dnf/ps-80-release-x86_64-bb45c1798280951b/packages/percona-server-client-8.0.21-12.2.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 8507efa5: NOKEY Percona Server 8.0 release/x86_64 YUM repositor 4.5 MB/s | 4.7 kB 00:00 Importing GPG key 0x8507EFA5: Userid : "Percona Development Team (Packaging key) <info@percona.com>" Fingerprint: 4D1B B29D 63D9 8E42 2B21 13B1 9334 A25F 8507 EFA5 From : /etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Running scriptlet: percona-server-server-8.0.21-12.2.el8.x86_64 1/1 Preparing : 1/1 Installing : perl-Exporter-5.72-396.el8.noarch 1/24 Installing : perl-libs-4:5.26.3-416.el8.x86_64 2/24 Installing : perl-Carp-1.42-396.el8.noarch 3/24 Installing : perl-Scalar-List-Utils-3:1.49-2.el8.x86_64 4/24 Installing : perl-macros-4:5.26.3-416.el8.x86_64 5/24 Installing : perl-parent-1:0.237-1.el8.noarch 6/24 Installing : perl-Errno-1.28-416.el8.x86_64 7/24 Installing : perl-Socket-4:2.027-3.el8.x86_64 8/24 Installing : perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch 9/24 Installing : perl-Unicode-Normalize-1.25-396.el8.x86_64 10/24 Installing : perl-File-Path-2.15-2.el8.noarch 11/24 Installing : perl-IO-1.38-416.el8.x86_64 12/24 Installing : perl-PathTools-3.74-1.el8.x86_64 13/24 Installing : perl-constant-1.33-396.el8.noarch 14/24 Installing : perl-threads-1:2.21-2.el8.x86_64 15/24 Installing : perl-threads-shared-1.58-2.el8.x86_64 16/24 Installing : perl-interpreter-4:5.26.3-416.el8.x86_64 17/24 Installing : net-tools-2.0-0.51.20160912git.el8.x86_64 18/24 Running scriptlet: net-tools-2.0-0.51.20160912git.el8.x86_64 18/24 Installing : make-1:4.2.1-10.el8.x86_64 19/24 Running scriptlet: make-1:4.2.1-10.el8.x86_64 19/24 Installing : compat-openssl10-1:1.0.2o-3.el8.x86_64 20/24 Running scriptlet: compat-openssl10-1:1.0.2o-3.el8.x86_64 20/24 Installing : percona-server-shared-compat-8.0.21-12.2.el8.x86_6 21/24 Running scriptlet: percona-server-shared-compat-8.0.21-12.2.el8.x86_6 21/24 Installing : percona-server-shared-8.0.21-12.2.el8.x86_64 22/24 Running scriptlet: percona-server-shared-8.0.21-12.2.el8.x86_64 22/24 Installing : percona-server-client-8.0.21-12.2.el8.x86_64 23/24 Running scriptlet: percona-server-server-8.0.21-12.2.el8.x86_64 24/24 Installing : percona-server-server-8.0.21-12.2.el8.x86_64 24/24 Running scriptlet: percona-server-server-8.0.21-12.2.el8.x86_64 24/24 Percona Server is distributed with several useful UDF (User Defined Function) from Percona Toolkit. Run the following commands to create these functions: mysql -e "CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_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'" See http://www.percona.com/doc/percona-server/8.0/management/udf_percona_toolkit.html for more details Verifying : compat-openssl10-1:1.0.2o-3.el8.x86_64 1/24 Verifying : make-1:4.2.1-10.el8.x86_64 2/24 Verifying : net-tools-2.0-0.51.20160912git.el8.x86_64 3/24 Verifying : perl-Carp-1.42-396.el8.noarch 4/24 Verifying : perl-Errno-1.28-416.el8.x86_64 5/24 Verifying : perl-Exporter-5.72-396.el8.noarch 6/24 Verifying : perl-File-Path-2.15-2.el8.noarch 7/24 Verifying : perl-IO-1.38-416.el8.x86_64 8/24 Verifying : perl-PathTools-3.74-1.el8.x86_64 9/24 Verifying : perl-Scalar-List-Utils-3:1.49-2.el8.x86_64 10/24 Verifying : perl-Socket-4:2.027-3.el8.x86_64 11/24 Verifying : perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch 12/24 Verifying : perl-Unicode-Normalize-1.25-396.el8.x86_64 13/24 Verifying : perl-constant-1.33-396.el8.noarch 14/24 Verifying : perl-interpreter-4:5.26.3-416.el8.x86_64 15/24 Verifying : perl-libs-4:5.26.3-416.el8.x86_64 16/24 Verifying : perl-macros-4:5.26.3-416.el8.x86_64 17/24 Verifying : perl-parent-1:0.237-1.el8.noarch 18/24 Verifying : perl-threads-1:2.21-2.el8.x86_64 19/24 Verifying : perl-threads-shared-1.58-2.el8.x86_64 20/24 Verifying : percona-server-client-8.0.21-12.2.el8.x86_64 21/24 Verifying : percona-server-server-8.0.21-12.2.el8.x86_64 22/24 Verifying : percona-server-shared-8.0.21-12.2.el8.x86_64 23/24 Verifying : percona-server-shared-compat-8.0.21-12.2.el8.x86_6 24/24 Installed: compat-openssl10-1:1.0.2o-3.el8.x86_64 make-1:4.2.1-10.el8.x86_64 net-tools-2.0-0.51.20160912git.el8.x86_64 percona-server-client-8.0.21-12.2.el8.x86_64 percona-server-server-8.0.21-12.2.el8.x86_64 percona-server-shared-8.0.21-12.2.el8.x86_64 percona-server-shared-compat-8.0.21-12.2.el8.x86_64 perl-Carp-1.42-396.el8.noarch perl-Errno-1.28-416.el8.x86_64 perl-Exporter-5.72-396.el8.noarch perl-File-Path-2.15-2.el8.noarch perl-IO-1.38-416.el8.x86_64 perl-PathTools-3.74-1.el8.x86_64 perl-Scalar-List-Utils-3:1.49-2.el8.x86_64 perl-Socket-4:2.027-3.el8.x86_64 perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch perl-Unicode-Normalize-1.25-396.el8.x86_64 perl-constant-1.33-396.el8.noarch perl-interpreter-4:5.26.3-416.el8.x86_64 perl-libs-4:5.26.3-416.el8.x86_64 perl-macros-4:5.26.3-416.el8.x86_64 perl-parent-1:0.237-1.el8.noarch perl-threads-1:2.21-2.el8.x86_64 perl-threads-shared-1.58-2.el8.x86_64 Complete!

    Enable and start Percona MySQL service.

    [root@percona-01 ~]# systemctl enable --now mysqld.service Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service รข /usr/lib/systemd/system/mysqld.service.

    Verify the version of Percona MySQL server.

    [root@percona-01 ~]# mysql -V mysql Ver 8.0.21-12 for Linux on x86_64 (Percona Server (GPL), Release 12, Revision 7ddfdfe)

    On first startup, the Percona MySQL service generates a random password for root user.

    You can obtain auto generated root password from MySQL logs by using following command.

    [root@percona-01 ~]# grep "temporary password" /var/log/mysqld.log 2020-11-20T15:48:32.560387Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: cjk-4sB/bWWt

    Secure your Percona MySQL server by executing mysql_secure_installation command and configure the security options as follows.

    [root@percona-01 ~]# mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: The existing password for the user account root has expired. Please set a new password. New password: Re-enter new password: The 'validate_password' component is installed on the server. The subsequent steps will run with the existing configuration of the component. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : N ... skipping. By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. 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!

    Percona Server for MySQL has been installed and configured on Linux server.

    Login to MySQL shell as root user.

    [root@percona-01 ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 22 Server version: 8.0.21-12 Percona Server (GPL), Release 12, Revision 7ddfdfe Copyright (c) 2009-2020 Percona LLC and/or its affiliates Copyright (c) 2000, 2020, 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>

    List down the available databases in your Percona MySQL server.

    mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.01 sec)

    Check the version of Percona MySQL server.

    mysql> select version(); +-----------+ | version() | +-----------+ | 8.0.21-12 | +-----------+ 1 row in set (0.00 sec)

    Exit from MySQL shell.

    mysql> exit Bye

     

    Conclusion:

    In this article, you have learned, how to install Percona Server for MySQL on CentOS 8. A recommended book on MySQL RDBMS is Murach's MySQL (3rd Edition) by Joel Murach.

    No comments:

    Post a comment