Wordpress mysql problem - Error establishing a database connection

  • Posted 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


I am also having this issue:-( Any idea how to fix? The only way I have found to fix the issue is to reset db security for the user account.

I’m having this same issue now. Have you continued to have this problem since your original posting?

Submit an 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.

I did run the mysqld and it worked: <br> <br><code> <br>sudo mysqld <br></code> <br> <br>I’m not so into it – a friend helped me with that.

I have the same problem and tried a number of suggestions, including upgrading to a 1GB droplet, adding a swap file etc… same problem.

I ended up creating an account here , transferred a copy of my site and it cleared up the problem, improved the performance dramatically and provided us with 24/7 support. This is one of those things where you get what you pay for.

i’ve solve the same problem with “rror establishing a database connection” ( Not Enough RAM ) by added Swap, tune SQL, Apache … <br> <br>Read this post for more detail : <br> <br>

@Tiago: Running mysqld manually isn’t recommended. Use this command instead: <pre>sudo service mysql start</pre>

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

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

You need to add swap: <a href=“”>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.