• info@bizmate.biz

Mysql – enable table logging in general_log

Mysql – enable table logging in general_log

Sometimes in DB used by different applications you might like to monitor what queries are executed and see them directly on your mysql client, like SqlYog or Sequel Pro.

This article does not necessarily show the best way of monitoring and analysing your queries but it is still a feature available in Mysql and it might come really handy if you dont have an alternative.

First of all you need to access your mysql server with a user that has permission to modify the “mysql” database.

 # mysql -u root -p

switch to the mysql databate

# use mysql;

then lets tell mysql that we want to direct the logging to a table rather than to a file (as I assume the default is file logging)

# SET GLOBAL log_output = 'TABLE';

Now lets tell the server to start logging all the queries

 # SET GLOBAL general_log = 'ON';

You should be able to see the queries being logged in from now on. Any questions let me know