Problem with logging slow queries

Discussion in 'MySQL' started by Fruktkaka, Oct 10, 2011.

  1. #1
    I'm trying to find out which queries are driving my database to a halt but I've got a problem actually getting the log to work.

    In my my.cnf I've put the following:

    [mysqld]
    slow_query_log = 1
    slow_query_log_file = /var/log/slow_queries.log
    long_query_time = 5

    I've restarted the server after this.

    If I go to my phpmyadmin and look at variables I can see the following:
    slow query log ON
    slow query log file /var/log/slow_queries.log

    If I click on Status in phpmyadmin I can see that there's been a lot of slow queries since I restarted the server.

    But the problem is; there is no slow_queries.log! :(
     
    Fruktkaka, Oct 10, 2011 IP
  2. Fruktkaka

    Fruktkaka Greenhorn

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #2
    Okay, solved this one myself and it wasn't MySQL related.

    I had to create the slow_queries.log myself and then set user mysql as the owner. Once that was done it started logging. :)
     
    Fruktkaka, Oct 10, 2011 IP
  3. supportex

    supportex Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #3
    User from which application is running must have permissions to entry in the directory with logs
     
    supportex, Oct 10, 2011 IP