2015/07/22

How to log all queries in mysql ?

-- enable db table logging
SET GLOBAL log_output = 'TABLE';
SET GLOBAL general_log = 'ON';
-- table with logs
select * from mysql.general_log
-- disable logging
SET GLOBAL general_log = 'ON';
-- enable file logging
SET GLOBAL log_output = "FILE"; -- which is set by default.
SET GLOBAL general_log_file = "/path/to/your/logfile.log";
SET GLOBAL general_log = 'ON';
Thanks to: http://stackoverflow.com/a/678310/991058

No comments:

Post a Comment