Skip to content

Instantly share code, notes, and snippets.

@keopx
Forked from juampynr/debug.md
Created August 20, 2014 15:54
Show Gist options
  • Save keopx/e6dab42f65e8ec17b395 to your computer and use it in GitHub Desktop.
Save keopx/e6dab42f65e8ec17b395 to your computer and use it in GitHub Desktop.

Start by logging into MySQL as root:

mysql -u root

Enter the following SQL statements:

SET GLOBAL query_cache_type=OFF;
SET global log_output = 'FILE';
SET global general_log_file='/tmp/query.log';
SET global general_log = 1;

Now load a page or run a command. All of its raw queries will be logged into /tmp/query.log.

You can remove the above settings by restarting MySQL:

sudo service mysql restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment