Can't connect to Azure MySQL flexible server, any ideas why?

284 Views Asked by At

I am trying to connect to the azure mysql flexible-server from MySQL workbench / azure-cli but have not been successful.

I have allowed connections to the server from my current IP. I followed the instructions on the Azure connections page and receive the error "unable to connect to localhost". I tried connecting from powershell using mysql command and receive the error 2003 (10060). I also tried connecting to server using azure-cli in docker container. I allowed connections to server from IP of container and logged in using "az login". I could run certain commands like "az mysql flexible-server db show" that would work, but when running "az mysql flexible-server connect ..." I would get timeout error. [Attempt from docker container](htattempt from MySQL workbenchtps://i.stack.imgur.com/cLZA5.png)

1

There are 1 best solutions below

0
Balaji On

While connecting Azure MySQL Flexible server with My SQL Workbench, the errors shows that unable to connect to localhost check with the user name provided in the Azure MySQL and also check the server name while replacing it into Hostname.

Follow the below steps to connect Azure MySQL Flexible server with MySQL Workbench:

  • Click on + which is beside MySQL Connections in MySQL Workbench. enter image description here

  • Provide Connection Name, Hostname, username and password which you have given in Azure MySQL Flexible Server. enter image description here

  • Click on Test Connection to check the connection if it is successful then it shows Successfully made the MySQL Connection as shown below. enter image description here

  • Then it successfully opens MySQL Workbench as shown below. enter image description here

And also after creation of MySql Flexible server in Azure it shows how to connect with MySQL Workbench under settings in connect option and what values are need to replaced with as shown below. enter image description here