Skip to content

Instantly share code, notes, and snippets.

@dungam
Last active July 26, 2016 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dungam/c99d10189c4e30c86d8a9af4d3f51dd5 to your computer and use it in GitHub Desktop.
Save dungam/c99d10189c4e30c86d8a9af4d3f51dd5 to your computer and use it in GitHub Desktop.
Enable MySQL general log
-- you can enable the log by change my.cnf settings (not recommended)
-- you can make changes on demand via your sql program, e.g workbench (recommended)
-- run the following commands to enable logging on demand.
# specify location for your log. Mysql needs write access to the folder specified
set global general_log_file = '/var/log/mysql/mysql.log';
# turn on login (1), turn off logging (0)
set global general_log = 1;
# see if your settings took effect
show variables like '%general_log%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment