Skip to content

Instantly share code, notes, and snippets.

@valdineireis
Created October 17, 2020 03:43
Show Gist options
  • Save valdineireis/d87a832a7f2a82009207980bfb6f3f3c to your computer and use it in GitHub Desktop.
Save valdineireis/d87a832a7f2a82009207980bfb6f3f3c to your computer and use it in GitHub Desktop.
Simples forma de visualizar os logs de execução do MySQL. Utilizo para conferir os SQLs gerados pelas ferramentas de ORM.
-- Visualizar o nome do arquivo de log
mysql> SHOW VARIABLES LIKE "general_log%";
-- Habilitar a escrita do log
mysql> SET GLOBAL general_log = 'ON';
-- Desabilitar a escrita do log
mysql> SET GLOBAL general_log = 'OFF';
-- Visualizar a execução da escrita dos logs (Executar em um outro terminal ou após sair do mysql)
tail -f -n300 "C:\Program Files\MariaDB 10.2\data\NAME-OF-YOUR-FILE.log"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment