query logging in MariaDB on Windows 10

2.2k Views Asked by At

How to enable {all type of, not just slow} query logging to FILE in MariaDB Server version: 10.4.11 running on Windows 10 ? I have modified my.ini file and added these line at the bottom but it did not worked

[mariadb]
log_output=FILE
general_log
general_log_file=queries.log

I have executed the same in console too with admin privilege but nothing happened, no error was either produced.

2

There are 2 best solutions below

1
On BEST ANSWER

Added at the bottom of my.ini and restarted MySQL

[mariadb]
general_log=1
log_output=FILE
general_log_file=queries.log

File created under mysql\data\queries.log

0
On

If you are using wamp server on windows 10.

Open my.ini file located in C:\wamp64\bin\mariadb\mariadb10.4.10\my.ini

Add the below code at the bottom of this file It will enable slow query logging to the file.

[mariadb]
slow_query_log=1
log_output=FILE
slow_query_log_file=c:/wamp64/logs/mariadb_slow.log
long_query_time=2
log_queries_not_using_indexes=ON

Restart MariaDB service to apply these changes. Reference https://mariadb.com/kb/en/slow-query-log-overview/