Skip to content

Instantly share code, notes, and snippets.

@phnahes
Created January 27, 2023 18:57
Show Gist options
  • Save phnahes/3d6d6bda4398e3ae026d9673a147d808 to your computer and use it in GitHub Desktop.
Save phnahes/3d6d6bda4398e3ae026d9673a147d808 to your computer and use it in GitHub Desktop.
Enable / Disable and Read MYSQL "general_log"
-- To Enable Query logging on the database
set global general_log = 1;
set global log_output = 'table'
-- For turn Hex readable:
select a.*, convert(a.argument using utf8) from mysql.general_log a;
-- To Disable Query logging on the database
set global general_log = 0;
-- To Clear query logs without disabling
TRUNCATE mysql.general_log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment