Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2372385
  • 博文数量: 473
  • 博客积分: 12252
  • 博客等级: 上将
  • 技术积分: 4307
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-12 10:02
文章分类

全部博文(473)

文章存档

2012年(8)

2011年(63)

2010年(73)

2009年(231)

2008年(98)

分类: Mysql/postgreSQL

2010-11-24 11:42:20

总所周知,mysql查看当前连接状态最常用的有
  1. mysqladmin -u root -p'123456' processlist
  2. mysqladmin -u root -p'123456' status
Uptime: 1214649  Threads: 1  Questions: 18565903  Slow queries: 580  Opens: 185291  Flush tables: 1  Open tables: 64  Queries per second avg: 15.285
   3.mysqladmin -h127.0.0.1 -u root -p'7232275' proc stat(上述两个命令的集合)
+--------+------+-----------------+----+---------+------+-------+------------------+
| Id     | User | Host            | db | Command | Time | State | Info             |
+--------+------+-----------------+----+---------+------+-------+------------------+
| 266813 | root | 127.0.0.1:47183 |    | Query   | 0    |       | show processlist |
+--------+------+-----------------+----+---------+------+-------+------------------+
Uptime: 1214711  Threads: 1  Questions: 18566703  Slow queries: 580  Opens: 185292  Flush tables: 1  Open tables: 64  Queries per second avg: 15.285

同事又问我,
mysql> show status like "Threads%";
+-------------------+--------+
| Variable_name     | Value  |
+-------------------+--------+
| Threads_cached    | 0      |
| Threads_connected | 1      |
| Threads_created   | 266901 |
| Threads_running   | 1      |
+-------------------+--------+
前几条命令显示的Threads,和show status like "Threads%"显示哪个对应呢?或者根本是两回事?
经过查阅mysql手册,发现Threads和show status like "Threads_running";是相对应的,请参考手册:
http://dev.mysql.com/doc/refman/5.1/en/mysqladmin.html
Threads

The number of active threads (clients).

http://dev.mysql.com/doc/refman/5.1/en/server-status-variables.html#statvar_Threads_created

Threads_running

The number of threads that are not sleeping.


阅读(1489) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~