MySQL stop by itself

mrtms posted 5 years ago in General
For some reason I'm having problems with my MySQL database going down. When it goes down I have to restart the MySQL even though it says it's already started. I have to physically Stop the MySQL and the Start it again through the Service Manager on my Windows Server 2008. This problem just began to occur yesterday and I have yet to find out what the problem is. Is there a way to turn debugging on so I can find out the source of the problem or someone gives me an explanation as to why this is happening. Thanks!
jfalch posted 5 years ago
a) if the mysql service is running (since you have to stop it), how do you recognize that your database is down ?

b) any intersting entries in the appliation part of the windows eventlog (eventvwr.exe), entries with source = "MySQL" ?
mrtms posted 5 years ago
Well I was able to recognize that it was down because all my websites couldn't connect to the database. So what I did was check the error log and found that it was at max_connections so I ended up changing that value and now it hasn't gone down since.
ansgar posted 5 years ago
You probably have some long running PHP process or whatever connects to MySQL through your webserver. This long process accessed and locked some important table. Other processes come in, waiting for the table lock to release, or in other words, for the long running query to finish. More and more processes come in from website visitors, until max_connections is reached.

This is a common scenaria I had several times at work on websites, Typo3 portals etc. The solution is to a) find and b) optimize the long running query. Increasing the max_connections value is a workaround, and does not speed up the waiting processes.

Please login to leave a reply, or register at first.