Error establishing a database connection

Posted December 28, 2019 571 views
DigitalOcean Managed MySQL DatabaseDigitalOcean Accounts


When I do to my new site (or try to login), I get this error-
“Error establishing a database connection”

It was working yesterday.

Note: New to DigitalOcean


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.

Submit an Answer
2 answers

Hello, @artisanseo

Could you please check if the MySQL/MariaDB service is running on your droplet? You can do that using this command:

service mysql status

Also if you’re using the Managed MySQL Database product you can ensure that everything is okay with it as well. You can double check if the database connection string is correct and that the database details (username and password) are correct and you can access the database using them.

Let me know how it goes.


Hello, Thanks for reaching out to DigitalOcean!

Request you to refer to below link, which provides insights about how to fix the Database error:

Best Regards,
Sri Charan

by Brian Boucheron
WordPress is one of the most popular open source content management systems in the world. Although it started out focused on blogging, over the years it has developed into a more flexible platform for websites in general. After almost fifteen years of development it is quite polished and robust, yet issues can still come up. If you've recently attempted to load your WordPress-powered website and instead saw a message stating "Error Establishing Database Connection", the cause is most often...