Mysql query log not working

I have a problem with mysql query log.

I searched for used my.cnf with https://stackoverflow.com/a/16831/ ... and added the line log = / var / log / mysqld_query.log to my.cnf. Then I restart mysql, but there is still no query log.

What is wrong here?

Thanks Flo

+5
source share
2 answers

You need to set general_logto 'ON'. see here

Add this to my.cnf, and then restart the MySQL server:

general_log = 1
log=/var/log/mysqld_query.log

or

SET GLOBAL general_log = 'ON';
+13
source

You can check if general_log is 'ON' or 'OFF' first using the query:

mysql>show variables like '%log%';

general_log "OFF", log =... . _log mysql ( mysql) cmd :

mysql>SET GLOBAL general_log = 'ON';

general_log_file .

+1

All Articles