how to connect my sql on azure via MySQL workbench

abdulraheem 20 Reputation points
2024-09-06T12:41:58.2833333+00:00

I have a virtual machine on Azure, accessed via SSH from my Ubuntu system. I set up a database on the VM and want to connect to it using MySQL Workbench for easier modifications, without using SSH in the terminal. Despite following the Azure help page instructions, I keep encountering the error below:

Screenshot 2024-09-06 100742

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. Vinodh247 34,661 Reputation points MVP Volunteer Moderator
    2024-09-06T14:31:15.9333333+00:00

    Hi abdulraheem,

    Thanks for reaching out to Microsoft Q&A.

    You are trying to connect to a MySQL database on an Azure Virtual Machine using MySQL Workbench from your local Ubuntu system, but you're encountering an error. The error message mentions that it cannot connect to the database server and refers to potential issues with rights, the MySQL server address, and port reachability.

    • SSH into your Azure VM and check if MySQL is running
    • MySQL, by default, listens on localhost (127.0.0.1). To allow remote connections, ensure that the the server is bound to the correct IP address
    • Make sure the user you are using (mdsteogust in this case) has access from remote machines
    • Ensure that port 3306 (default MySQL port) is open for inbound traffic in the NSG settings of your azure vm
    • Once the steps above are completed, go back to MySQL Workbench and use the public IP of your azure vm in the connection settings

    Please 'Upvote'(Thumbs-up) and 'Accept' as an answer if the reply was helpful. This will benefit other community members who face the same issue.


0 additional answers

Sort by: Most helpful

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.