error when etablishing database connection is a common error


I have just got my website moved to DigitalOcean. Before there was never a problem when “error when etablishing database connection is a common error” but now it comes more times a day.

My CMS is Wordpress. Do you have any idea why?

One hav told me it takes 48 hours before all DNS is working perfectly - is that correct? Because sometimes it works fine.



Show comments

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.

Thank you for the answer! I will see if I can get someone to help me with it.

Would you advice me to get the bigger solution with 2 core and 2 GB ram? Yesterday was a normal day in visits - the graph are from the last 24 hours.

This is not an uncommon issue when running WordPress on a 512MB or 1GB droplet. What happens is that the MySQL process allocates memory for itself and on these smaller droplets it can run out of physical memory.

Generally a Linux server will have a swap partition which is used to supplement the RAM but there is no swap partition by default on a droplet.

This issue can almost always be resolved by creating and enabling a swap file on your droplet.

This does not sound like it is at all related to your DNS change. DNS issues would result in your droplet not being reachable at all and since it is returning the database error page your web server is being reached.