MySQL 慢查询日志分析 pt-query-digest
打开查询日志,会记录所有查询 general_log=ON general_log_file=/home/logs/mysql.log 下载安装 官方文档 https://www.percona.com/doc/percona-toolkit/2.2/pt-query-digest.html wget http://www.percona.com/get/pt-query-digest yum -y install perl-Time-HiRes chmod +x pt-query-digest cp pt-query-digest /usr/bin/ 或者下载整套工具 wget percona.com/get/percona-toolkit.rpm rpm -ivh percona-toolkit-2.2.13-1.noarch.rpm wget percona.com/get/percona-toolkit.tar.gz tar -zxvf percona-toolkit-2.2.13.tar.gz cd percona-toolkit-2.2.13 perl Makefile.PL make && make install percona-toolkit工具包的使用教程之介绍和安装 http://blog.chinaunix.net/uid-20639775-id