Restarting Mysql Service Every 1 Hour?

Discussion in 'Site & Server Administration' started by SNaRe, Aug 6, 2008.

  1. #1
    I want to restart mysql service every 1 hour
    How can i do it with ssh cronjob
     
    SNaRe, Aug 6, 2008 IP
  2. TheHosted

    TheHosted Guest

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You do NOT want to restart MySQL every 60 minutes because if it stops while the database is being written to you will end up with a corrupted db.

    Why do you want it to restart so much?
     
    TheHosted, Aug 6, 2008 IP
  3. SNaRe

    SNaRe Well-Known Member

    Messages:
    1,132
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    165
    #3
    my mysql is giving high load when i restart , it turns to normal .
    so i need how to do it with ssh
    I wrote 0 * 1 1 1 /etc/rc.d/init.d/mysqld restart to cronjob
    I hope it work i will test
     
    SNaRe, Aug 6, 2008 IP
  4. zacharooni

    zacharooni Well-Known Member

    Messages:
    346
    Likes Received:
    20
    Best Answers:
    4
    Trophy Points:
    120
    #4
    Probably because he has high load, and hasn't tuned it correctly. Might be able to help with something like this.
     
    zacharooni, Aug 6, 2008 IP
  5. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #5
    I think it's
    0 * * * * /etc/init.d/mysql restart
    Code (markup):
    Jay
     
    jayshah, Aug 6, 2008 IP
  6. hostingspeak

    hostingspeak Peon

    Messages:
    233
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I think you need to find the source of the problem rather than to restart MySQL to get the load down. I think you need to find what's causing it in the first place.
     
    hostingspeak, Aug 6, 2008 IP
  7. Scavenger

    Scavenger Peon

    Messages:
    152
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Might be he needs to turn off persistent connections.
     
    Scavenger, Aug 6, 2008 IP