本文介绍了如何剖析MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何配置MySQL数据库.我想查看所有针对数据库运行的SQL.

How do I profile a MySQL database. I want to see all the SQL being run against a database.

我知道您可以这样做:

  • set profiling=1;
  • 运行缓慢的查询(例如SELECT * FROM messages WHERE fromaddress='xxx';
  • SHOW PROFILES;
  • set profiling=1;
  • Run your slow query (eg SELECT * FROM messages WHERE fromaddress='xxx';
  • SHOW PROFILES;

但这似乎仅适用于在命令行上运行的内容,我想查看运行网站的结果.

But this seem to only apply to stuff run on the command line, I want to see the results from running a website.

推荐答案

您需要查询日志-但是显然在繁重的生产服务器上这样做可能是不明智的.

You want the query log - but obviously doing this on a heavy production server could be... unwise.

这篇关于如何剖析MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 05:05