Error To Establishing Database Connection Showing

Posted March 7, 2015 1.8k views

I’m using Ubuntu 12.04.5 64Bit and zpanel in my vps, I’m using a WordPress site, But after a few hours, It is showing Error to Establishing Database Connection. I can’t login in zpanel, zpanel also showing database error. But after restarting my server, Website Runs for a few hours, then again this problem occurred. Now How can i solve this problem? Please help me.
My website is

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

One of the most likely reasons for an error like that is MySql crashing due to being out of memory. To confirm this, check the contents of /var/log/syslog for any error messages regarding “OOM” (out of memory) issues. One way to give yourself a little breathing room regarding memory is to create a SWAP file. Check out this tutorial for all the info:

by Etel Sverdlov
Linux swaps allow a system to harness more memory than was originally physically available. Here's how to set up a linux swap file on Ubuntu 12.04