Lost connection to database

December 21, 2014 740 views


I end up whit a connection lost to my database a couple off times a day and the only thing for me to fix this is to reboot the server.

I even have trouble then to login to my ISPConfig control panel.

What is wrong? Way is this happen?

1 Answer

The most common reason for MySQL to become unavailable or crash is a lack of available memory. If you are running a LAMP stack on a small droplet this can occur since droplets do not have a swap partition to use when the physical memory has been exhausted. There are a few things you can do to resolve this:

1.) Upgrade to a larger droplet plan.
2.) Set up swap space on your droplet.
3.) Optimize your MySQL and Apache processes.

by Justin Ellingwood
Swap space can be used as an "overflow" area for your system when you run out of RAM. The operating system can store data that would normally be kept in RAM on the hard drive in a specially formatted file. In this guide, we'll demonstrate how to create and use one of these files in Ubuntu 14.04.
Have another answer? Share your knowledge.