mysqlgenerallog
You can turn the MySQL general log on and off either dynamically (at runtime) or persistently (via configuration files). Turning this log on in production environments is generally discouraged except for brief debugging, as it logs every single query and can significantly impact performance.
To turn ON:
SET GLOBAL general_log = 'ON'; SET GLOBAL log_output = 'TABLE'; -- Optional: Logs to mysql.general_log table
To turn OFF:
SET GLOBAL general_log = 'OFF';
To check:
SHOW VARIABLES LIKE 'general_log%';
To truncate log:
SET GLOBAL general_log = 'OFF'; TRUNCATE TABLE mysql.general_log;
To view:
SELECT * FROM mysql.general_log ORDER BY event_time DESC;
mysqlgenerallog.txt · Last modified: by jwan
