mysql查询监控工具 [英] mysql query monitor tool
问题描述
我想实时查看所有运行mysql的查询(例如mssql中的事件探查器),但我尝试使用jet事件探查器,但结果却与mssql事件探查器不同.是否有这样的工具或内置选项可以输出到日志?
I would like to see live all mysql running queries (like profiler in mssql) I tried jet profiler, but I don't get same result as mssql profiler. Is there such a tool or maybe build in option to output to log?
我会讲更多的信息,也许有人会考虑解决方法.我使用实体框架从.net连接到mysql.有些查询在开发环境而不是生产环境中有效.我想查看已解析的查询,看看有什么问题.
I'll spill more light, maybe someone will think about workaround. I use entity framework to connect from .net to mysql. there are queries that work in development environment and not in production. I want to see parsed query to see what is wrong.
推荐答案
您可以编辑配置文件并启用日志记录.在my.cnf
中查找:
You can edit your configuration file and enable logging. In my.cnf
look for:
#
# * 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监视查询:
Uncomment the log
line than you can use tail to monitor the queries:
tail -f /var/log/mysql/mysql.log
您需要重新启动服务器以应用新配置.
You need to restart the server to apply the new configuration.
这篇关于mysql查询监控工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!