Unable to connect to MySQL flexible server on Azure on MySQL Workbench on PC.

Kamil Krauze (Student) 0 Reputation points
2023-01-23T19:30:35.1+00:00

As the title says, I am unable to connect to the MySQL database that is hosted on Azure through the MySQL workbench app installed on my PC. I always get the error "Could connect to localhost" which is odd
User's image

Like I followed all of the steps provided on the "Connect" tab of the DB server, as you know by now, it does not connect.

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
713 questions
{count} votes

7 answers

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 27,017 Reputation points Microsoft Employee
    2023-01-23T20:20:30.8533333+00:00

    Hi, @Kamil Krauze (Student) Welcome to the Microsoft Q&A platform, thanks for posting the question

    I understand you are facing an issue while trying to connect the Azure Mysql server from the Mysql workbench.

    1. Are you connecting from Azure (like Azure VM etc) or outside Azure?
    2. Are you able to connect using MySQL command line client or mysql.exe? for your reference Connect to the server by using mysql.exe
    3. Did you checked if the public IP of the client where your workbench is installed is whitelisted in em-nonprod-mysql-server-flex server?  Firewalls prevent all access to your database server until you specify which computers have permission. The firewall grants access to the server based on the originating IP address of each request. To configure a firewall, create firewall rules that specify ranges of acceptable IP addresses. You can create firewall rules at the server level. Firewall rules - Azure Database for MySQL | Microsoft Learn
      User's image Regards Geetha

  2. Batra, Vishal 0 Reputation points
    2023-02-14T18:35:46.5233333+00:00

    I am facing the same issue, Checked all the steps mentioned above

    But still having the same error


  3. Levien Dehertogh 0 Reputation points
    2023-07-26T17:55:40.19+00:00

    Hi @GeethaThatipatri-MSFT - I'm facing the same issue/error. Also checked above input, but still no luck. Any other idea? Thanks! Levien


  4. GkM-1383 0 Reputation points
    2023-07-27T23:30:50.17+00:00

    Comment deleted.

    0 comments No comments

  5. Stevie Rounds 0 Reputation points
    2023-09-06T00:00:24.8233333+00:00

    I have been having the same issue for the last 2 weeks connecting to our new Azure MySQL Flexible servers. I can use command line just fine to connect, but workbench errors out in both versions 8.0.33 and 8.0.34. Test connections are also successful, but actual connections get this error. I just tried 8.0.32 and it did work.

    User's image

    0 comments No comments