views:

44

answers:

4

Hi,

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 number of queries)

Is it possible?

Thanks!

A: 

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.

Jan Hančič
A: 

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

JosephStyons
A: 

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).

Seth
A: 

Thanks a lot, it workded!!

Manolis
This should be a comment, not an answer.
Jordan Ryan Moore