• articles


  • db
  • mysql

When using a ORM like hibernate it is always a good idea to check what SQL is generated/executed. This is how you enable a log of the SQL executed on the MySQL/MariaDB server:

SET global log_output = 'FILE';
SET global general_log_file='/var/log/mysql/mysql.log';
SET global general_log = 1;>

First line sets output to file, can also output to table. Second line defines location of output file. 3rd enables the SQL log output.