Error establishing a database connection. Wordpress on App Service

Volodymyr Shatalov - Focal Fact 0 Reputation points
2025-02-22T17:11:19.5933333+00:00

Hi there

Since morning 22 Feb 2025 our Wordpress on Azure(Azure Marketplace) app site stopped to work showing error "Error establishing a database connection". The was no any problem on Friday even around midnight, when everything worked perfectly.

Nothing has been changed in configuration, credentials are correct, app service was restarted, database server was restarted. Nothing helped.

Wordpress site was restored from automated backup, dated week ago when it worked properly, to newly created app service, but it shows the same error.

Are there any issues with Azure MySql services in North Europe region?

Any idea how to fix an issue and get site worked?

Regards

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
921 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Sam Rueby 86 Reputation points
    2025-02-23T19:00:21.92+00:00

    You must check the environment variables on the azure app service. You should have variables configured for DATABASE_HOST, DATABASE_NAME, DATABASE_USERNAME, DATABASE_PASSWORD. Are these values there? Did the database name change? Did the credentials change?


  2. Volodymyr Shatalov - Focal Fact 0 Reputation points
    2025-03-11T10:47:57.58+00:00

    It looks like an issue was with the database itself. It used 100% CPU all the time. I just restarted the database (it took almost 1 hour to complete) and site started to work again.

    0 comments No comments

  3. Shree Hima Bindu Maganti 3,675 Reputation points Microsoft External Staff
    2025-03-11T12:09:04.48+00:00

    Hi @Volodymyr Shatalov - Focal Fact
    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer.
    sol:
    It looks like an issue was with the database itself. It used 100% CPU all the time. I just restarted the database (it took almost 1 hour to complete) and site started to work again.
    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    0 comments No comments

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.