Report this

What is the reason for this report?

Wordpress mysql problem - Error establishing a database connection

Posted on January 27, 2014

Hi there,

I’ve recently got the $10/m package and I’ve got two sites running off the server. A static jekyll site, and a wordpress website.

I had both running really nicely, however, this morning I found: Error establishing a database connection when visiting the wordpress site. I ran free -m to see how much memory I had left and I could see there was only like 96mb left.

Can anyone help me figure out how it’d suddenly stop working and drain all the memory, and why, even after a restart I still can’t access the site. What can I do to fix and avoid this problem in the future. Do you recommend a higher package to run a wordpress website?

Thanks in advance



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

You need to add swap: <a href=“https://digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04”>How To Add Swap on Ubuntu 12.04</a>. WordPress is also best optimized with Nginx and caching. So, it’s advisable to check out (i) memcache; (ii) APC; (iii) varnish; and (iv) the W3 Total Cache plugin – in addition to switching to Nginx.

I already swapped but nothing has changed. Still got this error!

@Ibranhim, did you manage to fix it? we got the same problem here with an wordpress installation… :/

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.