【问题标题】:mysql query monitor tool [closed]mysql查询监控工具[关闭]
【发布时间】:2012-08-15 02:58:17
【问题描述】:

我想实时查看所有正在运行的 mysql 查询(如 mssql 中的分析器)我尝试了 jet profiler,但我没有得到与 mssql profiler 相同的结果。是否有这样的工具或内置选项来输出到日志?

我会透露更多信息,也许有人会考虑解决方法。我使用实体框架从.net 连接到 mysql。有些查询在开发环境中有效,而不是在生产环境中。我想查看解析后的查询,看看有什么问题。

【问题讨论】:

    标签: mysql


    【解决方案1】:

    您可以编辑配置文件并启用日志记录。在my.cnf 中寻找:

    #
    # * Logging and Replication
    #
    # Both location gets rotated by the cronjob.
    # Be aware that this log type is a performance killer.
    
    # log = /var/log/mysql/mysql.log
    

    取消注释 log 行,然后您可以使用 tail 监控查询:

    tail -f /var/log/mysql/mysql.log
    

    您需要重新启动服务器以应用新配置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多