如何读取innodb日志文件?
我想从 innodb 日志文件中查看“常规查询日志”,那么有人知道如何查看/读取这些查询日志吗?
我尝试了 MySQL 管理实用程序,它仅显示错误日志,查询日志被禁用。
I would like to see "general query log" from innodb log file, so is there anybody know how to see / read those query logs?
I tried MySQL admin utility, it shows only error log and query log is disabled.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
答案是你不能。
ib_logfile* 文件不包含查询,而是包含有关如何重新应用查询所做的更改的 512 字节对齐指令。例如:
The answer is that you can not.
The ib_logfile* files do not contain queries, but rather 512-byte aligned instructions on how to re-apply changes made by queries. For example:
记录查询会造成很大的性能负担,因此默认情况下禁用它。如果您想记录查询,请在 my.cnf 中设置日志变量。
如果您的应用程序处于活动状态,则不建议这样做,因为这会严重减慢速度,并且用户可能会收到 500 或连接超时错误。完成调试后对其进行评论。
Logging queries is a big performance overload, hence it is disabled by default. If you want to log queries then set log variable in my.cnf
It is not recommended if your application is live as it will slow it down really hard and users might get 500 or connection timeout errors. Once you are done debugging comment it.