Written by Sean Behan on Sat Mar 17th 2018

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";

Tagged with..
#mysql #databases #sql #logging

Just finishing up brewing up some fresh ground comments...