我在PHP中调用了函数mysql_stat()
,得到了以下结果:
正常运行时间:7733455
螺纹:1
问题:2218231
慢速查询:1552
开放时间:14989
刷新表:1
打开的表:6
每秒平均查询数:0.287
我在6天前创建了数据库,但是uptime
表明,它是在将近90天前(或者这是服务器的最后一次重新启动?)
查询beingslow query
的阈值是多少?
我能查一下,哪些查询速度慢?
如果我的数据库中只有3个表,那么open Tables
怎么可能是6?
条目的含义是什么?
是否可以重置统计数据?
最佳答案
由于PHP DOCS不鼓励使用mysql
扩展。改为使用mysqli
。
字段含义:
o Uptime
The number of seconds the MySQL server has been running.
o Threads
The number of active threads (clients).
o Questions
The number of questions (queries) from clients since the server was
started.
o Slow queries
The number of queries that have taken more than long_query_time
seconds. (MySQL DOSC "The Slow Query Log" section).
o Opens
The number of tables the server has opened.
o Flush tables
The number of flush-*, refresh, and reload commands the server has
executed.
o Open tables
The number of tables that currently are open.
o Memory in use
The amount of memory allocated directly by mysqld. This value is
displayed only when MySQL has been compiled with safemalloc, which
is available only before MySQL 5.5.6.
o Maximum memory used
The maximum amount of memory allocated directly by mysqld. This
value is displayed only when MySQL has been compiled with
safemalloc, which is available only before MySQL 5.5.6.
要重置此值,请在mysql服务器终端中使用
#> mysqladmin flush-host
。关于php - mysql_stat中的条目的含义是什么?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12035490/