Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following slow query information setup in mysql.


Variable_name     Value 
log_slow_queries  ON 
slow_launch_time  2
slow_query_log    ON 
slow_query_log_file   /var/log/mysql/slow-queries.log

The log file has the following premissions:

-rwxr-xr-x 1 root root 0 Sep 11 14:31 slow-queries.log

The my.cnf file looks like this:

back_log = 2000
slow_query_log = 1
slow_query_log_file = 1
long_query_time = 1 
general_log = 1

From mytop I can see that I have slow queries, but I don't see anything writing to the logs.

share|improve this question
What user is mysql running as? The log should be owned by that user. – Nathan C Oct 3 '13 at 19:07
NathanC is right slow-quesries.log needs to be mysql:mysql – Danila Ladner Oct 3 '13 at 19:40

As others have suggested, your problem is probably because of the the permissions on the log file.

If mysql runs under the "mysql" user, as it normally does, you can change the file ownership thusly:

chown mysql:mysql /var/log/mysql/slow-queries.log
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.