How to fix "Error establishing a database connection" in my Azure Web App?

Katherine Gerdes 10 Reputation points
2023-01-16T20:54:43.25+00:00

This is a WordPress deployment on Linux Web Apps. It was working fine until approximately 4 hours ago. Without me making any changes to my Web App, I started receiving the following error when I navigate to my Web App's URL:

"Error establishing a database connection"

Also, I get the following error when I navigate to my Web App's URL/wp-admin:

"Error establishing a database connection

This either means that the username and password information in your wp-config.php file is incorrect or that contact with the database server at 1e6cac4559f943359fba7f1acb82b568-dbserver.mysql.database.azure.com could not be established. This could mean your host’s database server is down.

  • Are you sure you have the correct username and password?
  • Are you sure you have typed the correct hostname?
  • Are you sure the database server is running?

If you are unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums."

I have been troubleshooting the problem through Azure Chat Support for over 3 hours now, and the Azure Chat Support agent has not been able to come up with a solution. When attempting to troubleshoot the issue, we discovered that the wp-config file appears to have been reset to a default state (e.g. no host, db name, username, or password data). Please let me know how I can fix this! Thank you.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Rijwan Ansari 766 Reputation points MVP
    2023-01-17T02:56:36.4233333+00:00
    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.