我在我的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_namehttp://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_namehttp://dev.mysql.com/doc/refman/5.6/en/performance-schema.html
更多推荐
发布评论