使用 MySQL status 查看是否还有 Query 进来

..

MySQL 想要看有没有 Query 进来,使用 MySQL show processlist; 看纪录可能不够,要看 status 的数字比较准,不然微秒的看不见

使用 MySQL status 查看是否还有 Query 进来

MySQL status 看到详细资讯如下:

mysql> status; -------------- mysql Ver 14.14 Distrib 5.6.32-78.1, for debian-linux-gnu (x86_64) using 6.3  Connection id: 1006466959 Current database: Current user: [email protected] SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 5.6.32-78.1-log Percona Server (GPL), Release 78.1, Revision 4c779b7 Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: latin1 Db characterset: latin1 Client characterset: utf8 Conn. characterset: utf8 UNIX socket: /var/run/mysqld/mysqld.sock Uptime: 1180 days 20 hours 11 min 36 sec  Threads: 3 Questions: 50320099254 Slow queries: 489806 Opens: 242974 Flush tables: 2 Open tables: 2048 Queries per second avg: 493.214

把一些噪声去掉,大概要看的就是下述:

mysql> status; -------------- Connection id: 1006466959 Server version: 5.6.32-78.1-log Percona Server (GPL) Uptime: 1180 days 20 hours 11 min 36 sec Threads: 3 Questions: 50320099254 Slow queries: 489806 Opens: 242974 Flush tables: 2 Open tables: 2048 Queries per second avg: 493.214

主要是看 Questions: 50320099254,这个数字若还有在增加,就代表有 Query 进来 (自己 status 应该也要算在里面)

想在手机阅读更多MySQL资讯?下载【香港硅谷】Android应用
分享到Facebook