R_U*_*ser 2 php mysql statistics
我mysql_stat()
用PHP 调用了函数,它给了我以下结果:
我在6天前创建了数据库,但是uptime
建议,这是近90天前(或者这是服务器的最后一次重启?)
查询的阈值是slow query
多少?
我可以以某种方式检查,哪些查询慢?
怎么可能open Tables
是6,如果我的数据库中只有3个表?
什么是条目的含义Threads
,Opens
和Flush tables
?
是否可以重置统计数据?
由于PHP DOCSmysql
不鼓励使用扩展名.请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.
Run Code Online (Sandbox Code Playgroud)
要重置此值#> mysqladmin flush-host
,请在mysql服务器终端中使用.