Question

Error establishing a database connection

Hi,

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

Thanks, Ken


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.

Hello, Thanks for reaching out to DigitalOcean!

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

https://www.digitalocean.com/community/tutorials/how-to-debug-the-wordpress-error-establishing-database-connection

Best Regards, Sri Charan

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.

Regards, Alex