## 分析慢查询日志
1、mysqldumpslow:
```
mysqldumpslow -t 3 /var/lib/mysql/e3edd0de9e5d-slow.log;
```
![](https://img.kancloud.cn/64/1e/641e04eb3618f8e8be444054b457fad7_1064x370.png)
2、pt-query-digest:
1)、安装pt-query-digest:
```
wget percona.com/get/pt-query-digest;
chmod u+x pt-query-digest;
mv /root/pt-query-digest /usr/bin/;
```
![](https://img.kancloud.cn/63/77/637714b5e46b7e677fceee8fcedbb213_1438x738.png)
2)、简单使用:
```
pt-query-digest /var/lib/mysql/e3edd0de9e5d-slow.log | more;
```
![](https://img.kancloud.cn/e6/0d/e60d2dff58babf3d04c6a992bc395b42_1166x601.png)