引言
上一篇文章擦俐,我們介紹了mysql的安裝http://www.reibang.com/p/f625a5be8ec4。本篇文章我們來介紹一下Percona Toolkit工具。Percona Toolkit是一款percona公司推出的優(yōu)秀的開源的mysql分析工具。我們可以用它來做很多的性能分析
一.安裝
1.先按照之前的文章安裝上mysql
2.自動從官網(wǎng)上下載最新的包來安裝
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 便可成功外厂。
二.使用
參考網(wǎng)址: 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
有兩種解決辦法:
- 在 vim /etc/my.cn中設(shè)置default_authentication_plugin=mysql_native_password冕象。
重啟數(shù)據(jù)庫systemctl restart mysqld - 接入數(shù)據(jù)庫后輸入
ALTER USER 'username'@'ip_address' IDENTIFIED WITH mysql_native_password BY 'password';
其中的username, ip_address汁蝶, password根據(jù)實際情況填寫