Unable to connect to Azure Database for MySQL flexible server from MySQL Workbench

Morsi 30 Reputation points
2023-09-08T10:42:52.3066667+00:00

I have created a web app with a MySQL database (web app + database in Azure Marketplace), and everything is working fine. I have successfully deployed a PHP "Hello World" code. Now, I want to connect to the MySQL database using MySQL Workbench. So, I went to the flexible server and clicked on "Connect" to determine the connection parameters.

User's image

I went to the "Networking" section to download the SSL certificate as instructed (for your information, in the Networking section, everything is grayed out, and I am unable to add anything as shown in the image).

User's image

I have configured the connection with MySQL Workbench.

User's image

When I try to connect, I receive the famous error message.

User's image

I'm not sure why it's still trying to connect to localhost despite entering the server name as indicated in Azure (in the Connect section).

However, I'm open to exploring alternative solutions to connect to my MySQL database and explore it myself, as well as for developers.

thanks for your help.

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

Accepted answer
  1. Kenny Pak 75 Reputation points
    2023-09-10T01:39:35.6166667+00:00

    Ok, I found a workaround for the time being:

    1. use "az webapp create-remote-connection" to create an SSH connection to the web app instance
    2. ssh into the instance
    3. apt-get install mariadb-client

    This is less than ideal but will work for now

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Morsi 30 Reputation points
    2023-09-08T13:57:21.12+00:00

    I want to let you know that it works when I create a new Azure Database for MySQL flexible server independently of the Web App, and I have access to the Networking of the database to add my IP address to the firewall, enable external connections, etc. So, I'm not sure why it doesn't work when it's created directly with the Web App.

    1 person found this answer helpful.
    0 comments No comments

  2. SSingh-MSFT 16,371 Reputation points Moderator
    2023-09-08T12:08:07.27+00:00

    Hi Morsi •,

    Welcome to Microsoft Q&A forum and thanks for using Azure Services.

    As I understand, you could not open Azure Database for MySQL through MySQL Workbench.

    Could you please let us know what Network configuration is selected while creation of this flexible server?

    Also refer to the below mentioned Youtube video for reference if this helps:

    Connect & Query Azure Database for MySQL Flexible Server using MySQL Workbench

    Thanks

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.