Mysql slow.log用户具体(Mysql slow.log user specific)

编程入门 行业动态 更新时间:2024-10-18 22:28:30
Mysql slow.log用户具体(Mysql slow.log user specific)

我在我的MySQL服务器上使用slow.log日志来捕获我的脚本中的瓶颈,但同时我在这台服务器上使用phpmyadmin 。 我的脚本和phpmyadmin有不同的MySQL用户帐户,现在,当我分析slow.log文件时,我看到很多来自phpmyadmin查询的垃圾邮件,是否有可能将MySQL配置为仅记录来自特定用户的慢查询?

I use a slow.log logging on my MySQL server to catch bottlenecks in my scripts, but at the same time I use phpmyadmin on this server. My scripts and phpmyadmin has different MySQL user accounts and now, when I analyzing the slow.log file, I see a lot of spam from phpmyadmin queries, is it possible, to configure the MySQL to logging a slow queries only from specific users?

最满意答案

如果使用MySQL 5.6,您可以使用性能模式,并查看那里的不同语句摘要。

有帐户摘要(someuser @ somehost),仅通过用户名(someuser)或仅通过主机(somehost)。

请参阅下表:

performance_schema.events_statements_summary_by_account_by_event_name performance_schema.events_statements_summary_by_user_by_event_name performance_schema.events_statements_summary_by_host_by_event_name performance_schema.events_statements_summary_global_by_event_name

http://dev.mysql.com/doc/refman/5.6/en/performance-schema.html

If using MySQL 5.6, you can use the performance schema, and look at the different statements summaries there.

There are summaries by account (someuser@somehost), by username alone (someuser) or by host alone (somehost).

See the following tables:

performance_schema.events_statements_summary_by_account_by_event_name performance_schema.events_statements_summary_by_user_by_event_name performance_schema.events_statements_summary_by_host_by_event_name performance_schema.events_statements_summary_global_by_event_name

http://dev.mysql.com/doc/refman/5.6/en/performance-schema.html

更多推荐

本文发布于:2023-07-07 21:35:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1068490.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:用户   slow   Mysql   log   specific

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!