WordPress droplet 'Error Establishing Database Connection' very often


I’ve been having an issue with a WordPress droplet of mine that seems to go down quite often. In each time, when I go to the website I get ‘Error Establishing Database Connection’. The only way for me to resolve this is to restart the server, but it could be days before I realize that the droplet is down and a huge inconvenience. I am looking for guidance or some investigation into how to avoid this or why it is occurring.

Thanks, Marcus

Submit an answer
Answer a question...

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.

Hi there Marco,

What I could suggest is following the steps from this tutorial here on how to tweak your MySQL configuration for better reliability:

Additionally, I would recommend checking your MySQL error log so that you could get some more information on what might be going wrong. It sounds like the server might be running out of RAM.

If this is the case, I would suggest considering adding a bit of extra RAM and possibly a SWAP file:

Let me know how it goes!