Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Percona Server in linux CentOS

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you the detailed installation tutorial of installing Percona Server in linux CentOS. I believe most people do not know how to install it. In order to let you learn, I have summarized the following contents. Without saying much, let's read on.

Percona Server mainly has two relatively simple installation methods, one is to download the installation package for local installation, and the other is to install online through the official rpm source link.

First go to the official installation documentation:

Installing Percona Server for MySQL 8.0.18-9

Environment release Notes:

CentOS 8Percona Server for MySQL 8.0.18 Local installation

For local installation, you need to download the installation package to the system. The download address of Percona Server is as follows:

Https://www.percona.com/downloads/Percona-Server-LATEST/

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

Then go to the command line and download it with 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

Extract the Percona Server package according to the following command:

[root@localhost / usr/local/src] # mkdir Percona-Server # unzipped files [root@localhost / usr/local/src] # tar-xvf Percona-Server-8.0.18-9-r53e606f-el8-x86_64-bundle.tar-C Percona-Server # unzipped and stored in the Percona-Server directory [root@localhost / usr/local/src] # ls Percona-Server # after decompression It's just a bunch of .rpm files percona-mysql-router-8.0.18-9.1.el8.x86_64.rpmpercona-mysql-router-debuginfo-8.0.18-9.1.el8.x86_64.rpmpercona-server-client-8.0.18-9.1.el8.x86_64.rpmpercona-server-client-debuginfo-8.0.18-9.1.el8.x86_64.rpmpercona-server-debuginfo-8.0.18-9.1.el8.x86. _ 64.rpmpercona-server-debugsource-8.0.18-9.1.el8.x86_64.rpmpercona-server-devel-8.0.18-9.1.el8.x86_64.rpmpercona-server-rocksdb-8.0.18-9.1.el8.x86_64.rpmpercona-server-rocksdb-debuginfo-8.0.18-9.1.el8.x86_64.rpmpercona-server-server-8.0.18-9.1.el8.x86_64.rpmpercona-server-server -debuginfo-8.0.18-9.1.el8.x86_64.rpmpercona-server-shared-8.0.18-9.1.el8.x86_64.rpmpercona-server-shared-compat-8.0.18-9.1.el8.x86_64.rpmpercona-server-shared-debuginfo-8.0.18-9.1.el8.x86_64.rpmpercona-server-test-8.0.18-9.1.el8.x86_64.rpmpercona-server-test-debuginfo-8 .0.18-9.1.el8.x86_64.rpmpercona-server-tokudb-8.0.18-9.1.el8.x86_64.rpmpercona-server-tokudb-debuginfo-8.0.18-9.1.el8.x8664.rpm [root @ localhost / usr/local/src] #

The installation of Percona Server depends on jemalloc, so we have to prepare the rpm package for jemalloc before installing Percona Server. Download links can be obtained at the following URL:

Https://pkgs.org/download/jemalloc

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 through the yum command:

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

After waiting for a moment to complete the installation, start Percona Server, and the startup command is the same as starting MySQL:

[root@localhost ~] # systemctl start mysqld

Port 3306 is listening normally, which means that the startup is successful:

[root@localhost ~] # netstat-lntp | grep mysqltcp6 0 0: 33060: * LISTEN 21964/mysqld tcp6 0 0: 3306: * LISTEN 21964/mysqld [root@localhost] # online installation

Online installation is easier than local installation, and it only takes a few commands to install. 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

You can now install Percona Server directly through the yum command:

[root@localhost] # yum install-y percona-server-serverTips: online installation has certain requirements on the network, otherwise it will be very slow

Similarly, wait a moment for the installation to complete, and then start Percona Server:

[root@localhost ~] # systemctl start mysqld

Port 3306 is listening normally, which means that the startup is successful:

[root@localhost ~] # netstat-lntp | grep mysqltcp6 0 0:: 33060: * LISTEN 12549/mysqld tcp6 0 0: 3306: * LISTEN 12549/mysqld [root@localhost ~] # system Settings

Disable the boot self-boot of Percona Server:

[root@localhost ~] # systemctl disable mysqldRemoved / etc/systemd/system/multi-user.target.wants/mysqld.service.Removed / etc/systemd/system/mysql.service. [root@localhost ~] # Tips: the reason for disabling boot is that in a PXC cluster, when a node goes down and restarts, it will randomly synchronize data with a PXC node. If the downtime of the node is too long, the amount of data that needs to be synchronized will be large. When a large amount of data synchronization occurs, the PXC cluster restricts other write operations until all the data is synchronized successfully. So after a long downtime, the right thing to do is not to start the node immediately, but to copy data files from other nodes to that node before starting. In this way, there will be much less data that needs to be synchronized and will not cause a long speed limit.

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

[root@localhost ~] # firewall-cmd-- zone=public-- add-port=3306/tcp-- permanentsuccess [root@localhost ~] # firewall-cmd-- reloadsuccess [root@localhost ~] # modify database configuration

Modify the configuration file:

[root@localhost ~] # vim / etc/my.cnf [mysqld] # set character set ipbind-address=0.0.0.0# monitored by character_set_server=utf8# settings skip DNS parsing skip-name-resolve

Restart Percona Server:

[root@localhost ~] # systemctl restart mysqld

Then change the default password for the root account. We can find the initial default password in the log file of mysql. The red box in the following figure indicates 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, remote login is generally not allowed for root accounts, so we need to create a separate database account for remote access:

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

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

The above is the installation tutorial to install Percona Server in linux CentOS, and the details of the use also need to be used by yourself in order to understand. If you want to know more about it, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report