How to log every query on MySQL
To know every SQL query being executed on your server, you have to:
- set debug on;
- specify the output;
- know how to look at it.
Here are the commands that address these three issues. You must run them as superuser on your MySQL:
SET GLOBAL general_log = 'ON';
SET GLOBAL log_output = 'TABLE';
select * from mysql.general_log;