Sometimes, you need to figure out which request comes from cms / cmf or another script to the Mysql server. For example, I had to deal with the jqgrid-php library. It was unclear which query comes to the mysql server from the script.
You can, of course, install and configure mysql-proxy, but there is a simpler solution:
Login to Mysql-server as mysql admin (root) user.
Set where to write the log:
set global general_log_file='/tmp/mysql_query.log';
set global general_log = 1;
Run your scripts
Turn it off so it does not clog the server
set global general_log = 0;
less /tmp/mysql_query.log