-
In your vagrant box edit
/etc/mysql/my.cnf
-
uncomment these two lines
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
-
restart your vagrant box
-
all queries will now be logged to
/var/log/mysql/mysql.log
- note that you will have to open a root shell to access this file
-
(optionally) copy the log file somewhere
# cat /var/log/mysql/mysql.log > /vagrant/sites/codeup.dev/logs/mysql.log
-
Be aware that you should probably not do this long term,
- taken straight from
my.cnf
# Be aware that this log type is a performance killer.
- taken straight from
Note: after running an ansible command to create a new db, the my.cnf
file was reset!