1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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