1

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.

2
  • 1
    What user is mysql running as? The log should be owned by that user.
    – Nathan C
    Oct 3, 2013 at 19:07
  • 1
    NathanC is right slow-quesries.log needs to be mysql:mysql Oct 3, 2013 at 19:40

1 Answer 1

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .