从mysql中的query_id查找查询
我可以从 mysql 查询 id 找到确切的查询吗?
这是 MySQL 中的“SHOW ENGINE INNODB STATUS”的一部分:
MySQL thread id 1106, query id 1360 localhost 127.0.0.1 test2
---TRANSACTION 0 19491, not started, OS thread id 2960035840
有没有办法可以找到 id 1360 的查询是什么?
Can I find the exact query from mysql query id?
This is a part of "SHOW ENGINE INNODB STATUS"
in MySQL:
MySQL thread id 1106, query id 1360 localhost 127.0.0.1 test2
---TRANSACTION 0 19491, not started, OS thread id 2960035840
Is there a way by which I can find what was the query with id 1360?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只需将此行添加到 my.cnf
然后重新启动 mysql 服务 (
/etc/init.d/mysql stop
/etc/init.d/mysql start
)然后跟踪日志文件。里面好像有查询id!
另请参阅http://www.jeff-barr.com/?p=112和 http://dev.mysql.com/doc/refman/5.1/en/query-log.html
Just added this line to my.cnf
Then restarted mysql service (
/etc/init.d/mysql stop
/etc/init.d/mysql start
)Then tailed the log file. Seemingly there is a query id in it!
See also http://www.jeff-barr.com/?p=112 and http://dev.mysql.com/doc/refman/5.1/en/query-log.html
您可以使用以下命令:
它将为您提供所有当前正在运行的进程及其查询 ID 和正在执行的查询。
You can use the following command:
It will give you all currently running process with their query ID and query that is being executed.
有些人说打开“常规日志”,您将通过 id 找到您的查询。
http://forums.mysql.com/read.php?22 ,419784,419896#msg-419896
Some folks say turn on 'general log' and you'll find your query by id.
http://forums.mysql.com/read.php?22,419784,419896#msg-419896