Percona Toolkit(pt)的安装与使用

引言

上一篇文章,我们介绍了mysql的安装https://www.jianshu.com/p/f625a5be8ec4。本篇文章我们来介绍一下Percona Toolkit工具。Percona Toolkit是一款percona公司推出的优秀的开源的mysql分析工具。我们可以用它来做很多的性能分析

一.安装

1.先按照之前的文章安装上mysql
2.自动从官网上下载最新的包来安装

yum install percona-toolkit -y

注:博主在安装的过程中遇到一个提示,大意是Percona-Server与mysql版本冲突问题
Transaction check error:
file /etc/my.cnf from install of Percona-Server-shared-56-5.6.40-rel84.0.el7.x86_64 conflicts with file from package mysql-community-server-5.7.23-1.el7.x86_64

实际的解决方式是要先安装mysql-community-libs-compat

yum install mysql-community-libs-compat -y

然后再安装percona-toolkit 便可成功。

二.使用

参考网址: http://blog.51cto.com/arthur376/1893321

但是在使用的过程中会遇到这样一个错误
DBI connect(';host=127.0.0.1;mysql_read_default_group=client','root',...) failed: Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory at /usr/bin/pt-deadlock-logger line 2435

图1.错误示例demo

有两种解决办法:

  1. 在 vim /etc/my.cn中设置default_authentication_plugin=mysql_native_password。
    重启数据库systemctl restart mysqld
  2. 接入数据库后输入

ALTER USER 'username'@'ip_address' IDENTIFIED WITH mysql_native_password BY 'password';

其中的username, ip_address, password根据实际情况填写

图2.正常结果
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容