Last active
August 29, 2015 14:14
-
-
Save dmgig/09b183bcfbf03a1d049d to your computer and use it in GitHub Desktop.
mysql: momentarily enable general log file / table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mysql: momentarily enable, then view, general log table | |
SET GLOBAL log_output = 'TABLE'; | |
SET GLOBAL general_log = 'ON'; | |
SELECT SLEEP(5); | |
SET GLOBAL general_log = 'OFF'; | |
SELECT * FROM mysql.general_log; | |
###### | |
# OR # | |
###### | |
# mysql: momentarily enable general log file | |
SET GLOBAL log_output = "FILE"; // default | |
SET GLOBAL general_log_file = "/var/log/mysql-general.log"; | |
SET GLOBAL general_log = 'ON'; | |
SELECT SLEEP(5); | |
SET GLOBAL general_log = 'OFF'; | |
# original: http://stackoverflow.com/questions/650238/how-to-show-the-last-queries-executed-on-mysql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment