Skip to content

Instantly share code, notes, and snippets.

@souhaiebtar
Created December 7, 2022 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save souhaiebtar/365ef0bf446bd332a707f9ac8b664425 to your computer and use it in GitHub Desktop.
Save souhaiebtar/365ef0bf446bd332a707f9ac8b664425 to your computer and use it in GitHub Desktop.
[log all sql queries in mariadb or mysql] log all sql queries in mariadb or mysql to a file #log #sql #mysql #maria

for mysql 5.6+, add to the mysql config file the next block of code

[mysqld]
general_log = on
general_log_file=/usr/log/general.log

for mariadb, add to the mariadb config file the next block

[mariadb]
general_log=1
log_output=FILE
general_log_file=/queries.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment