Logging MySQL queries in table

Just came around a handy (i.e. Docker environment) logging feature of MariaDB.

Enable logging:

SET global general_log = 1;
SET global log_output = 'table';

 

View query log:

SELECT * FROM mysql.general_log
-- OR --
SELECT * FROM mysql.general_log ORDER BY event_time DESC

 

Disable logging:

SET global general_log = 0;
Advertisements

Author: Michal Zuber

Full stack developer, biker and rollerblader. Owner and developer at https://nevilleweb.sk/ Co-founded http://neville.sk/ Blog at https://michalzuber.wordpress.com/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s