今天想安装个Percona Toolkit简称pt工具来优化mysql索引,系统环境centos6。
官方网址https://www.percona.com/downloads/percona-toolkit/LATEST/
找到percona-toolkit-3.2.1-1.el6.x86_64.rpm,复制下载地址
想直接安装,不行。
[root@hl-img-m ~]# yum -y install https://www.percona.com/downloads/percona-toolkit/3.2.1/binary/redhat/6/x86_64/percona-toolkit-3.2.1-1.el6.x86_64.rpm
Loaded plugins: security
Setting up Install Process
Cannot open: https://www.percona.com/downloads/percona-toolkit/3.2.1/binary/redhat/6/x86_64/percona-toolkit-3.2.1-1.el6.x86_64.rpm. Skipping.
Error: Nothing to do
直接下载下来安装
wget https://www.percona.com/downloads/percona-toolkit/3.2.1/binary/redhat/6/x86_64/percona-toolkit-3.2.1-1.el6.x86_64.rpm
提示缺少依赖包
[root@hl-img-m software]# rpm -ivh ./percona-toolkit-3.2.1-1.el6.x86_64.rpm
warning: ./percona-toolkit-3.2.1-1.el6.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 8507efa5: NOKEY
error: Failed dependencies:
perl(DBI) >= 1.13 is needed by percona-toolkit-3.2.1-1.el6.x86_64
perl(DBD::mysql) >= 1.0 is needed by percona-toolkit-3.2.1-1.el6.x86_64
perl(IO::Socket::SSL) is needed by percona-toolkit-3.2.1-1.el6.x86_64
perl(Term::ReadKey) is needed by percona-toolkit-3.2.1-1.el6.x86_64
安装依赖包方式:
yum install perl-DBI perl-DBD-MySQL perl-Digest-MD5 perl-IO-Socket-SSL perl-TermReadKey
自动安装依赖包:
yum install -y percona-toolkit-3.2.1-1.el6.x86_64.rpm
成功;
看看使用
[root@hl-img-m software]# pt-duplicate-key-checker –user=root -password=root –socket=/tmp/mysql.sock
忘记不是在测试数据库上了,将就看看。