Skip to content

Instantly share code, notes, and snippets.

@carltondickson
Last active August 29, 2015 14:23
Show Gist options
  • Save carltondickson/66cdd9293ce0cd694a7b to your computer and use it in GitHub Desktop.
Save carltondickson/66cdd9293ce0cd694a7b to your computer and use it in GitHub Desktop.
MySQL toggle query logging
nano ~/.bash_aliases
alias mysql_turn_on_query_logging = "mysql -h localhost -uroot -p -e \"SET GLOBAL log_output = 'FILE'; SET GLOBAL general_log_file='/tmp/mysql_general.log'; SET GLOBAL general_log = 1;\""
alias mysql_turn_off_query_logging = "mysql -h localhost -uroot -p -e \"SET GLOBAL general_log = 0;\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment