0

I have mysql 5.1.69-log:

and this settings according to /etc/my.cnf:

slow-query-log = 1
slow-query-log-file = /var/log/mysqld_slow.log
log-queries-not-using-indexes = 1
long_query_time = 1

also checked mysql @@global settings:

@@global.log_output = FILE
@@global.long_query_time = 1.000000
@@global.log_slow_queries = 1
@@global.slow_query_log_file = /var/log/mysqld_slow.log

but /var/log/mysqld_slow.log not being created and if I create it by myself, it's still empty

can't understand where is a problem?

  • Do you have queries taking over 1 second? The MySQL doc says that you can specify that long_query_time in microseconds - so maybe if you drop the time very low or even to 0 and see what happens then? – mikemil Feb 12 '14 at 21:05
  • just set `long_query_time = 0.001` to check, `[!!] Slow queries: 6% (2K/45K)`, but still nothing in `/var/log/mysqld_slow.log` –  Feb 12 '14 at 21:22
  • Any chance there's a Linux permission issue with the mysql group having write access to /var/log/? – mikemil Feb 12 '14 at 21:26
  • there are also `/var/log/mysqld.log` in /var/log and it's being written without any problem –  Feb 12 '14 at 21:28
  • sorry, there are can be some permission problem, because I've moved `mysqld_slow.log` to `/tmp` and it works, but can't understand why it was not working in `/var/log` –  Feb 12 '14 at 21:31
  • Sorry, I work in Windows all day - Mac, a bit in the evenings. Guess you start by looking at the folder permissions for /var/log and also ensure that mysql is running as the mysql group? (I think) – mikemil Feb 12 '14 at 21:34
  • yes, mysql is running with it's own group, seems to be `/var/log` permissions –  Feb 12 '14 at 21:41

0 Answers0