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.

Sleeping mysql queries and optimize database

Discussion in 'MySQL' started by nes_jr429, May 6, 2013.

  1. #1
    Hello everyone, how can I trace sleeping mysql queries on my database? And what terminal can I use to execute commands in my remotes mysql database to optimize it? thanks... :)
     
    nes_jr429, May 6, 2013 IP
  2. xrvel

    xrvel Notable Member

    Messages:
    918
    Likes Received:
    30
    Best Answers:
    2
    Trophy Points:
    225
    #2
    you can execute the query below to trace sleeping queries
    SHOW FULL PROCESSLIST
    Code (markup):
     
    xrvel, Jul 1, 2013 IP
  3. macfraser

    macfraser Member

    Messages:
    81
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #3
    There is also a query log feature in mysql that you can use to find troublesome queries. It is great for finding slow / non optimized queries. However you do need to configure it to start logging. Here are the documents. http://dev.mysql.com/doc/refman/5.1/en/query-log.html
     
    macfraser, Jul 4, 2013 IP
  4. nes_jr429

    nes_jr429 Member

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #4
    thanks for your replies, I'll try these.. cheers.. :)
     
    nes_jr429, Jul 4, 2013 IP