There are few things you can do.
First if you are using function wrappers (for example query()
as a wrapper for mysqli_query()
) then you can echo the query from inside it (or save it to log file).
Second, you could enable General Query Log in MySQL (not recommended on live servers, since it can take a lot of space very fast!). There you may find everything that mysqld has done. More at http://dev.mysql.com/doc/refman/5.1/en/query-log.html
Third, you could install mysql proxy, which would run between your scripts and mysql, and it could output everything sent to your database. More at http://dev.mysql.com/downloads/mysql-proxy/
It all depends on what you prefer, and what is suitable for your situation.
Let me know what you think.