Skip to content

Instantly share code, notes, and snippets.

@demagu
Last active June 29, 2018 09:03
Show Gist options
  • Save demagu/578f61998fa0d4ea75d8 to your computer and use it in GitHub Desktop.
Save demagu/578f61998fa0d4ea75d8 to your computer and use it in GitHub Desktop.
How-To: Enable MySQL query log in Vagrant

Enable MySQL query log in Vagrant

Since 5.1 query logging can be enabled at runtime.

Login to your MySQL server

mysql -uroot -p

See current setup

mysql> SHOW VARIABLES LIKE "general_log%";

At this point make sure log file is created and mysql can write to this file.

mysql> SET GLOBAL general_log = 'ON';

In case MySQL crapps out:

apt-get purge mysql-server mysql-common mysql-client-<version>

then

apt-get install mysql-server mysql-common mysql-client

In case MySQL upgrade is required:

apt-get install mysql-client-core-5.6
apt-get install mysql-client-5.6
apt-get install mysql-server-5.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment