Wordpress on App service broken - "Error establishing a database connection”

MJ Lytics 0 Reputation points
2024-04-01T09:48:44.78+00:00

I have tried installing from the Azure Marketplace "Wordpress on App Service" on my Basic App Service plan.

After installing all i see is : "Error establishing a database connection”.

I tried to click on "repair" button and the wp_posts table was missing in the mysql DB. so i created it by finding the SQL for that table. No more phpmyadmin errors. However I still get the same error as above.

I followed some instructions to activate error logging , but i am not able to see any logs.

I read another community blog post on MS/Azure website..(https://developercommunity.microsoft.com/t/Wordpress-website-is-down-Database-unrea/10553789?res_id=%2Fsubscriptions%2Fd7dab749-415b-4518-b627-700e3aca77fd%2FresourceGroups%2Fwebsite%2Fproviders%2FMicrosoft.Web%2Fsites%2Fauditlytics&res_type=Compute&sku=Basic&publish_type=container&session_id=43616a91162f43478e3fc37fe337af3e&q=Wordpress) but I seem to be going in circles for the past 2 hours.

How is the Microsoft's own Marketplace app for Wordpress broken ? Can anyone provide a solution ?

Many thanks.

MJ

Already read:

https://azureossd.github.io/2015/10/14/wordpress-error-establishing-a-database-connection/

https://azureossd.github.io/2015/10/09/logging-php-errors-in-wordpress-2/

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

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 17,886 Reputation points
    2024-04-05T21:12:44.87+00:00

    Hi @MJ Lytics we are sorry to hear you're facing this issue. based on the Azure status page, it doesn't look like there are any Azure outages.

    Here are a few things worth looking into:

    1. Usually, this error is caused by incorrect database credentials. If you’ve recently moved your WordPress site to a new host, this could be the likely cause. Your WordPress database credentials are stored in the wp-config.php file. This file contains essential settings, including database information. Open your wp-config.php file and make sure that the values for DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST match your actual database credentials. If not, update them accordingly.
    2. Sometimes the database server might be down. Verify if your database server is operational.
    3. Lastly, please make your Azure Database for MySQL server has firewall rules allowing connections from your App Service's IP address. You can temporarily allow connections from all IP addresses for testing purposes but tighten them later for security.

    If the issue persists after following these steps, let us know so we can troubleshoot further.

    Best,

    Grace

    1 person found this answer helpful.
    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.