2

mysql_stat()我在 PHP 中调用了该函数,结果如下:

  • 正常运行时间:7733455
  • 主题:1
  • 问题:2218231
  • 慢查询:1552
  • 打开:14989
  • 冲洗表:1
  • 打开表:6
  • 每秒平均查询次数:0.287

我在 6 天前创建了数据库,但uptime建议是将近 90 天前(或者这是服务器的最后一次重新启动?)

查询蜂的阈值是slow query多少?

我可以以某种方式检查,哪些查询慢?

open Tables如果我的数据库中只有 3 个表,怎么可能是 6 个?

Threads条目的含义是Opens什么Flush tables

是否可以重置统计信息?

4

2 回答 2

7

由于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.

要重置此值#> mysqladmin flush-host,请在您的 mysql 服务器终端中使用。

于 2012-08-20T09:55:01.600 回答
2

如果您的网站托管在共享主机中,则该信息可能来自多个数据库,而不仅仅是您的!:)

于 2013-06-10T20:03:55.883 回答