MySQL passwords invalid, rebooting droplet fixes it

June 11, 2014 953 views
I'm running Vesta CP on a droplet. I've noticed that every few weeks (perhaps monthly), all MySQL credentials—including root—become invalid and I get connection errors on all my sites. if I reboot the droplet, everything works again for a few weeks. Any idea what's going on here?
2 Answers
MySQL is being killed by the OOM killer.
As the above answer says, it's very likely that MySQL is being killed by the OOM killer. That means it is running out of memory. You can confirm this by checking /var/log/syslog after this happens. If that's the case and it really only is happening every few weeks, you probably don't need to upgrade to a larger droplet. You can probably get away with just adding some swap to the system. This article should point you in the right direction:
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.