Install Percona Server database (in CentOS 8)

Building a PXC cluster under CentOS8 article describes how to build a Percona Server cluster. In fact, the PXC installation package has been bundled with Percona Server, so some details of Percona Server will be shielded during installation. But sometimes Percona Server may be used alone, so this article separately introduces the installation of Percona Server. It should be noted that Percona Server only supports Linux systems and cannot be installed on other operating systems.

There are two simpler installation methods for Percona Server. One is to download the installation package for local installation, and the other is to install it online through the official rpm source link.

First go to the official installation document:

Environmental version description:

Local installation###

Local installation needs to download the installation package to the system. The download address of Percona Server's official website is as follows:

Open the above URL, select the corresponding version and operating system, and finally copy the download link of the installation package:

Then go to the command line to download through the wget command:

[ root@localhost ~]# cd /usr/local/src
[ root@localhost /usr/local/src]# wget https://www.percona.com/downloads/Percona-Server-LATEST/Percona-Server-8.0.18-9/binary/redhat/8/x86_64/Percona-Server-8.0.18-9-r53e606f-el8-x86_64-bundle.tar

Decompress the compressed package of Percona Server as follows:

[ root@localhost /usr/local/src]# mkdir Percona-Server  #Create a new directory to store the extracted files
[ root@localhost /usr/local/src]# tar -xvf Percona-Server-8.0.18-9-r53e606f-el8-x86_64-bundle.tar -C Percona-Server  #Unzip and save the unzipped file to Percona-Server directory
[ root@localhost /usr/local/src]# ls Percona-Server #After decompression, there are a bunch of.rpm file
percona-mysql-router-8.0.18-9.1.el8.x86_64.rpm
percona-mysql-router-debuginfo-8.0.18-9.1.el8.x86_64.rpm
percona-server-client-8.0.18-9.1.el8.x86_64.rpm
percona-server-client-debuginfo-8.0.18-9.1.el8.x86_64.rpm
percona-server-debuginfo-8.0.18-9.1.el8.x86_64.rpm
percona-server-debugsource-8.0.18-9.1.el8.x86_64.rpm
percona-server-devel-8.0.18-9.1.el8.x86_64.rpm
percona-server-rocksdb-8.0.18-9.1.el8.x86_64.rpm
percona-server-rocksdb-debuginfo-8.0.18-9.1.el8.x86_64.rpm
percona-server-server-8.0.18-9.1.el8.x86_64.rpm
percona-server-server-debuginfo-8.0.18-9.1.el8.x86_64.rpm
percona-server-shared-8.0.18-9.1.el8.x86_64.rpm
percona-server-shared-compat-8.0.18-9.1.el8.x86_64.rpm
percona-server-shared-debuginfo-8.0.18-9.1.el8.x86_64.rpm
percona-server-test-8.0.18-9.1.el8.x86_64.rpm
percona-server-test-debuginfo-8.0.18-9.1.el8.x86_64.rpm
percona-server-tokudb-8.0.18-9.1.el8.x86_64.rpm
percona-server-tokudb-debuginfo-8.0.18-9.1.el8.x86_64.rpm
[ root@localhost /usr/local/src]# 

The installation of Percona Server depends on jemalloc, so before installing Percona Server, we have to prepare the rpm package of jemalloc. You can get the download link from the following website:

Enter the newly created Percona-Server directory and download the rpm package of jemalloc:

[ root@localhost /usr/local/src]# cd Percona-Server
[ root@localhost /usr/local/src/Percona-Server]# wget http://rpms.remirepo.net/enterprise/8/remi/x86_64//jemalloc-5.1.0-3.el8.remi.x86_64.rpm

After completing the above steps, you can now install Percona Server locally via the yum command:

[ root@localhost /usr/local/src/Percona-Server]# yum localinstall -y *.rpm

After waiting for the installation to complete, start Percona Server. The startup command is the same as that of MySQL:

[ root@localhost ~]# systemctl start mysqld

There is a normal listening port 3306, which means the startup is successful:

[ root@localhost ~]# netstat -lntp |grep mysql
tcp6       00:::33060:::*       LISTEN      21964/mysqld        
tcp6       00:::3306:::*       LISTEN      21964/mysqld        
[ root@localhost ~]# 

Online installation###

Online installation is simpler than local installation, and the installation can be completed with only a few commands. First install the official yum repository:

[ root@localhost ~]# yum install -y https://repo.percona.com/yum/percona-release-latest.noarch.rpm

Then enable the warehouse:

[ root@localhost ~]# percona-release setup ps80

Now you can install Percona Server directly through the yum command:

[ root@localhost ~]# yum install -y percona-server-server

Similarly, after waiting for a moment for the installation to complete, start Percona Server:

[ root@localhost ~]# systemctl start mysqld

There is a normal listening port 3306, which means the startup is successful:

[ root@localhost ~]# netstat -lntp |grep mysql
tcp6       00:::33060:::*       LISTEN      12549/mysqld        
tcp6       00:::3306:::*       LISTEN      12549/mysqld
[ root@localhost ~]# 

System Settings###

Disable the automatic startup of Percona Server:

[ root@localhost ~]# systemctl disable mysqld
Removed /etc/systemd/system/multi-user.target.wants/mysqld.service.
Removed /etc/systemd/system/mysql.service.[root@localhost ~]# 

If the system has a firewall enabled, you need to open port 3306:

[ root@localhost ~]# firewall-cmd --zone=public--add-port=3306/tcp --permanent
success
[ root@localhost ~]# firewall-cmd --reload
success
[ root@localhost ~]#

Modify database configuration###

Modify the configuration file:

[ root@localhost ~]# vim /etc/my.cnf
[ mysqld]
# Set character set
character_set_server=utf8
# Set the listening ip
bind-address=0.0.0.0
# Skip DNS resolution
skip-name-resolve

Restart Percona Server:

[ root@localhost ~]# systemctl restart mysqld

Then modify the default password of the root account. We can find the initial default password in the mysql log file. The red box in the figure below shows the default password:

Then use the mysql_secure_installation command to change the password of the root account:

[ root@localhost ~]# mysql_secure_installation 

For security reasons, the root account generally does not allow remote login, so we need to create a separate database account for remote access:

[ root@localhost ~]# mysql -uroot -p
mysql> create user 'admin'@'%' identified by 'A123456a.';
mysql> grant all privileges on *.* to 'admin'@'%';
mysql> flush privileges;

Finally, use the connection tool to test the remote connection:

So far, we have successfully installed Percona Server on CentOS 8. Since Percona Server is basically compatible with MySQL, all operations are no different from MySQL. You only need to use it as MySQL. I won't go into details here.

Recommended Posts

Install Percona Server database (in CentOS 8)
Install MySQL5.7 in centos7
Install php in centos
Install redis5.0 in CentOS7
Centos7 install Mysql database
Install Oracle11gR2 database under CentOS6.9
install virtualbox on centos server
Install MongoDB database under CentOS7
Install Nginx server on CentOS 7
Install JDK8 in rpm on CentOS7
Minimal install JDK 1.8 tutorial in CentOS 7
How to install PHP7.4 in CentOS
CentOS configuration git server in VirtualBox
Install MySql with Docker in CentOS7
Tencent Cloud Centos7 install java server
Install java in yum mode in Centos
​Install Oracle database on CentOS Linux
CentOS7.2 install lepus database monitoring system
How to install HDP2.6 in Centos7.2
Install Centos7 operating system in Docker
1.5 Install Centos7
CentOS7 install and use SQL Server
CentOS 7 install gogs git code server
Install and configure FreeIPA in Centos7
Centos8 uses Apache httpd2.4.37 to install web server steps in detail
How to install Android SDK in centos7
Install jetty in Ubuntu 18.04 Server, non-apt version
Compile and install nodejs and yum in Centos8
Install Docker CE in yum under CentOS 7
Centos6 install Python2.7.13
Centos7.3 install nginx
CentOS install Redmine
Centos7 install Python 3.6.
CentOS7 install MySQL
Centos7 install protobuf
CentOS7 install GlusterFS
CentOS 7.4 install Zabbix 3.4
Centos6.5 install Tomcat
CentOS install Python 3.6
Vmware install CentOS6
centos7 install docker-ce 18.01.0
CentOS 7.2 install MariaDB
CentOS 7 install Hadoop 3.0.0
Centos7 install Python2.7
Centos 7.6 install seleniu
CentOS 7.3 install Zabbix3
Centos7 install LAMP+PHPmyadmin
CentOS install mysql
CentOS install openjdk 1.8
CENTOS6.5 install CDH5.12.1 (1)
CentOS install PHP
CentOS6 install mist.io
Centos7 install Docker
CentOS7 install mysql
centOs install rabbitMQ
CentOS 7 install MySQL 5.6
Centos7 install Nginx
CentOS6.5 install CDH5.13
Centos7 install docker18
Centos install Python3
centos7 install docker