The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL always crash every sunday morning

Discussion in 'Database Discussions' started by DEVNEB, May 25, 2015.

  1. DEVNEB

    DEVNEB Member

    Joined:
    Feb 11, 2009
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Québec, Canada
    Hi there,

    I'm using MySQL 5.6.23 on WHM 11.48.4 (build 4) / CENTOS 6.6 x86_64 xenpv.

    Since two months or so, every sunday morning (around 1AM UTC-5) MySQL stop working, I need to restart it manually. And otherwise it would start by itself like 4 to 6 hours after it has crashed.

    In the mysql log there is nothing related to a shutdown except when I manually did the graceful reboot.

    Do you have any clue what would cause this strange behaviour and how to resolve it?

    Thanks.
     
  2. rishivispute

    rishivispute Member

    Joined:
    May 23, 2010
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    pune
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Please check cron logs and I think one of the cron stop mysql serivce.

    I suggest that you add the sript which start the mysql automatically, so you do not need to start it manually.

    The following script is used to start mysql automatically when it is failed or stopped on the server.

    1) open file vi /root/automysqlstart.sh and add the following code and save it

    ========

    #!/bin/bash

    #Checking whether MySQL is alive or not

    if mysqladmin ping | grep -q "alive"; then

    echo "MySQL is up"

    else

    /etc/init.d/mysqld restart

    fi

    ============================

    2) You can set 2 min cron and it restart the mysql automatically.

    vi /var/spool/cron/root
    */2 * * * * /bin/sh /root/automysqlstart.sh

    3) Done
     
  3. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Yes, You can setup this script on your server but first you will have to find out root the cause of this mysql issues. I will suggest you please monitor you server process and mysql error logs on your server that time.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,451
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Home »Service Configuration »Service Manager, MySQL Server - should take care of keeping MySQL up.

    Around 1 AM, are backups running?

    Is the server overloaded?

    Sounds like you need to hire someone to take a closer look at your server.
     
  5. DEVNEB

    DEVNEB Member

    Joined:
    Feb 11, 2009
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Québec, Canada
    Thanks for those tips and advices, really appreciated.

    Yes, backups are running at 1AM every day, but MySQL crash only on sunday which is really strange.
    No the server is normally never overloaded.

    True, maybe we should investigate further, I'm calling my tech, but in the meantime I need MySQL to be always up and running.
     
Loading...

Share This Page