CentOS7下安装percona-toolkit工具包的安装

一、检查和安装与Perl相关的模块

依赖检查命令为  rpm -qa perl-DBI perl-DBD-MySQL perl-Time-HiRes perl-IO-Socket-SSL

应该有以上四个依赖包,如果没有,请使用下面的命令安装

yum install perl-DBI

yum install perl-DBD-MySQL

yum install perl-Time-HiRes

yum install perl-IO-Socket-SSL

二、下载percona-toolkit工具包

1、下载工具包percona-toolkit

参照:https://www.percona.com/doc/percona-toolkit/3.0/installation.html#installing-percona-toolkit-on-red-hat-or-centos

# yum install -y http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm

 

2、查看可以安装的工具包

yum list | grep percona-toolkit

3、安装percona-toolkit工具包

yum install -y percona-toolkit

出现以下页面即为成功

CentOS7下安装percona-toolkit工具包的安装_第1张图片

如果这一步出现了错误,

错误一:

The GPG keys listed for the "Percona-Release YUM repository - x86_64" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.


 Failing package is: Percona-Server-shared-56-5.6.45-rel86.1.el7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Percona


解决办法

yum update percona-release

错误二:

Transaction check error:
  file /etc/my.cnf from install of Percona-Server-shared-56-5.6.45-rel86.1.el7.x86_64 conflicts with file from package mysql-community-server-8.0.17-1.el7.x86_64

Error Summary
 

这里说明提示在my.cnf文件中, Percona-Server-shared与mysql-community-server冲突,需要安装mysql-community-libs-compat 才可以搞定

  1、本地环境检查

[root@VM_0_10_centos src]# more /etc/redhat-release
CentOS Linux release 7.6.1810 (Core) 
[root@VM_0_10_centos src]# rpm -qa|grep -i mysql 
mysql-community-common-8.0.17-1.el7.x86_64
mysql-community-libs-8.0.17-1.el7.x86_64
mysql-community-server-8.0.17-1.el7.x86_64
mysql-community-client-8.0.17-1.el7.x86_64

通过上面的查看,确实没有libs-compat包安装到本机,可以通过两个办法解决,一个是通过yum直接下载mysql-community-libs-compat(如果之前你是使用yum安装mysql的话),而我是使用本地文件解压安装,所以要去本地的文件夹下找到这个安装包,将其安装。

解决办法一:

yum install mysql-community-libs-compat -y 

解决办法二:

找到当成安装mysql的解压包

CentOS7下安装percona-toolkit工具包的安装_第2张图片

在当前路径下使用rpm  -ivh  mysql-community-libs-compat-8.0.17-1.el7.x86_64.rpm --nodeps  --force安装

rpm  -ivh  mysql-community-libs-compat-8.0.17-1.el7.x86_64.rpm --nodeps  --force

CentOS7下安装percona-toolkit工具包的安装_第3张图片

成功解决该问题

 

3、最后使用yum install -y percona-toolkit再次进行安装,成功安装完成

yum install -y percona-toolkit

CentOS7下安装percona-toolkit工具包的安装_第4张图片

4、检验安装是否成功pt-query-digest --help

CentOS7下安装percona-toolkit工具包的安装_第5张图片

成功安装,接下来可以探索其他的玩法了!

参考博文链接:https://www.cnblogs.com/h--d/p/9320776.html

https://aqzt.com/5366.html

你可能感兴趣的:(Percona-toolkit,linux)