Created
October 17, 2020 03:43
-
-
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.
This file contains 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
-- 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