Because of firewall problem, TCP keep alive problem, and MySQL own parameter problem these three are more common in use, so share the troubleshooting method that you found today.
Let's talk about a firewall today.
Most people start trying to connect after the first time the MySQL database on Azure instance is created. However, the result that is often encountered is not a successful connection but the error message as shown:
This error message indicates that your IP address is not within the access range of the MySQL on Azure firewall, which can in some way avoid malicious dictionary attacks by the production user who set up the simple password, and of course, Azure has other means to protect against malicious intrusion after the rescue method, But that's not what this article is about.
Now that you know that your access request is blocked by the firewall, the first step is to add the client's IP address to the allowed list in the firewall.
First open the MySQL database on the Azure portal, click " Connect Security " and the " Add client IP" button appears in the right panel.
Click Add client IP , here Enter your firewall's access IP list name (custom), IP start address, IP end address
Fill in the current IP and click Save. Wait a moment to open your MySQL Azure journey.
Note
Avoid setting the IP range to 0.0.0.0-255.255.255.255 as shown below, which means that the Azure firewall is invalidated.
hope to help friends who have the same problem in Azure, if you don't see the picture, you can Click here View
About connection problems encountered in daily use of azure MySQL and how to troubleshoot them