MySQL always crash every sunday morning

DEVNEB

Member
Feb 11, 2009
7
0
51
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.
 

rishivispute

Member
May 23, 2010
11
0
51
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
 

24x7server

Well-Known Member
Apr 17, 2013
1,912
99
78
India
cPanel Access Level
Root Administrator
Twitter
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.
 

DEVNEB

Member
Feb 11, 2009
7
0
51
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.