Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have the following slow query information setup in mysql.

SHOW VARIABLES LIKE '%SLOW%';

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
log-slow-queries=/var/log/mysql/slow-queries.log

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

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

1 Answer 1

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

 
discard

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.