代码之家  ›  专栏  ›  技术社区  ›  Joe Holloway

自MySQL Server启动以来的所有查询计数

  •  1
  • Joe Holloway  · 技术社区  · 17 年前

    如何确定自MySQL服务器启动以来执行了多少查询?

    4 回复  |  直到 17 年前
        1
  •  1
  •   Joe    17 年前
    mysqladmin proc stat
    

    这将为您提供一个问题计数(以及其他信息),它是服务器请求的查询数。

    返回的信息中一个方便的部分是查询计数缓慢。希望是0。:)

        2
  •  2
  •   Chad Birch    17 年前

    如果要在查询中执行,而不是运行外部程序:

    SHOW GLOBAL STATUS LIKE 'Questions';
    
        3
  •  0
  •   Plutor    17 年前

    在MySQL5.1.31或更高版本中,您可以 show status 并用名称“查询”签出该行

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

    如果没有5.1,请使用“问题”行。在5.1中,它不会在保存的过程中包含查询。

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

        4
  •  0
  •   bass    17 年前

    只是 mysqladmin状态-p

    应该给你有用的信息和具体的信息。