无法连接到 Azure MySQL 灵活服务器,有什么想法吗?

问题描述 投票:0回答:1

我正在尝试从 MySQL Workbench / azure-cli 连接到 azure mysql 灵活服务器,但没有成功。

我已允许从我当前的 IP 连接到服务器。我按照 Azure 连接页面上的说明进行操作,但收到错误“无法连接到本地主机”。我尝试使用 mysql 命令从 powershell 连接并收到错误 2003 (10060)。我还尝试在 docker 容器中使用 azure-cli 连接到服务器。我允许从容器的 IP 连接到服务器并使用“az login”登录。我可以运行某些命令,例如“az mysql secure-server db show”,该命令可以工作,但是当运行“az mysql secure-server connect ...”时,我会收到超时错误。 [Attempt from docker container](https://i.stack.imgur.com/cLZA5.png)

azure mysql-workbench azure-mysql-database
1个回答
0
投票

将 Azure MySQL 灵活服务器与 My SQL Workbench 连接时,错误显示

unable to connect to localhost
检查 Azure MySQL 中提供的用户名,并在将其替换为
Hostname
时检查服务器名称。

按照以下步骤将 Azure MySQL 灵活服务器与 MySQL Workbench 连接:

  • 单击 MySQL Workbench 中 +

     旁边的 
    MySQL Connections
    enter image description here

  • 提供您在 Azure MySQL 灵活服务器中提供的

    Connection Name
    Hostname
    username
    password
    enter image description here

  • 点击

    Test Connection
    检查连接是否成功,然后显示成功建立MySQL连接,如下所示。 enter image description here

  • 然后就成功打开MySQL Workbench了,如下图。 enter image description here

在 Azure 中创建 MySql 灵活服务器后,它显示了如何在

connect
选项的设置下连接 MySQL Workbench,以及需要替换哪些值,如下所示。 enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.