Can’t connect to Azure Database for MySQL server

ClearDB is killing off the free micro-tiers of MySQL. Like many MSDN subscribers with WordPress sites (I’m guessing), I chose to migrate my blog database to Azure Database for MySQL server, which would consume Azure credit instead of my credit card. After moving the database over and pointing my blog to it, I received the dreaded Error establishing a database connection page.

Browsing to /wp-admin on my site confirmed it was pointing to the correct database. I confirmed authentication credentials were valid, but the App Service could not connect.

No IPs allowed initially

Azure SQL databases are initially provisioned to allow Azure resources through the firewall. The firewall will not block anything originating from the IP range of Azure’s datacenters.

This is not the case for Azure Database for MySQL server. In fact, the feature is not yet available to enable (supposedly it’s coming soon though), so you will need to manually unblock the IP of your App Service (or more likely, a larger IP range in case the IP address changes). As usual, Microsoft Docs has great step-by-step instructions on configuring the firewall.

Leave a Reply

Your email address will not be published.