0
votes

I have two Wordpress sites hosted on Azure and when I try to visit them through the browser I get the message: "Error establishing a database connection"

I used FileZilla to inspect the wp-config.php and checked all the fields for DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST. All the strings correspond correctly to what is shown through the Azure portal and on the ClearDB panel.

Another thing I tried was to add "define( 'WP_ALLOW_REPAIR', true );" to the bottom of wp-config.php and visit www.mywebsite.com/wp-admin/maint/repair.php, but this page does not come up.

In the Azure panels, everything appears to be running fine.

What can I do to fix this problem?

1
Just double check your credentials. Something is missing. Try to upload simple php script to select and dump sql data, and verify, that your credentials are good. Usually it's just mixed credentials, or file was uploaded with wrong permissions and apache can't access it - omxv
When I go to mysite.com/wp-admin there is this message: "We were able to connect to the database server (which means your username and password is okay) but not able to select the DB_NAME database." where DB_NAME is the name of the database - William Ross
Does your wordpress site work fine on your local environment with the database connection to ClearDB? - Gary Liu
Yea, turns out ClearDB was the issue... I did not pay them apparently, and once that was resolved it works again. - William Ross

1 Answers

0
votes

Turns out ClearDB had not received a payment from me in awhile so they shut down by service temporarily. After I added a payment method they resumed my service quickly and it is working again.