Error To Establishing Database Connection Showing

March 7, 2015 686 views
MySQL WordPress Ubuntu

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 http://bandbazar.com

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
Have another answer? Share your knowledge.