开发者

How to see which queries has been executed. (mysql)

开发者 https://www.devze.com 2022-12-13 15:52 出处:网络
I run a site at localhost and I would like to see which queries are executed. I\'ve seen that some pages execute a lot of queries (eg 107) and I would like to see which are all these,as I think they\'

I run a site at localhost and I would like to see which queries are executed. I've seen that some pages execute a lot of queries (eg 107) and I would like to see which are all these,as I think they're a lot.. (I know how many queries are executed, as the queries are executed through a function which also stores at a global value the开发者_如何学JAVA number of queries)

Is it possible?

Thanks!


Modify the function that you use to execute queries, so that it will log them into a file or just output them at the bottom of the page for instance. There is no tool or (built-in) function that would tell you what was executed on some specific request.


You can trace a mysql database as described at this link.


Turn on the MySQL general query log. Quite useful during development, it will show you literally everything that your server is doing.

As such, I wouldn't recommend enabling it on a production server (at least not for long).

0

精彩评论

暂无评论...
验证码 换一张
取 消