Error Establishing Database Connection

Hello there, Can someone please help me, I always got this Error Establishing Database Connection on my website and it almost appears every day. I am on 512mb / 20GB disk Plan ( Droplet) and my traffics range is only 500-800 traffics daily. Can someone please tell me how to fix this issue? Almost getting this issue from the beginning I created my website. My website Plugins posted below:

BackUpWordPress Complete Analytics Optimization Suite (CAOS) Easy Social Share Buttons for WordPress EasyRecipe Plus Envato Market Facebook Pixel Instant Articles for WP Jetpack by jQuery Pin It Button for Images Pro Nginx Helper Redirection W3 Total Cache Wordfence Security WP Smush WP-Optimize Yoast SEO

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


You’re getting that error because MySQL is crashing and so WordPress is no longer able to connect to it. MySQL and WordPress, especially with a lot of plugins installed, both require a lot of memory and a 512MB Droplet is not enough to handle those requirements.

I would recommend upgrading to a 1GB Droplet first—we have recently introduced new plans so you will be able to do that without any additional cost. But, you might want to also consider upgrading to a 2GB Droplet to make sure that both programs have some room to breathe.

Additionally, check out this tutorial on setting up Redis Caching. It is a bit old but the same instructions should work, though you might have to replace php5 with php7: