How to Log and Query SQL Queries Hitting Your Database with MySQL
Here is some code just in case you want to look at and query the queries hitting your MySQL database.
Enter this from the mysql client console.
mysql> SET GLOBAL log_output = 'TABLE'
mysql> SET GLOBAL general_log = 'ON';
mysql> select event_time, argument from mysql.general_log
To stop logging you just type
mysql> SET GLOBAL general_log = 'OFF';
You can also log to a file if that is more convenient
mysql> SET GLOBAL log_output = 'FILE';
mysql> SET GLOBAL general_log_file = "/path/to/file.log";
Comments