【发布时间】:2017-07-25 10:32:29
【问题描述】:
我使用完全相同的凭据和默认设置从装有 Windows Server 2012 R2 的虚拟机连接到 Azure SQL 数据库,就像我在装有 Windows 10 的笔记本电脑上使用的那样。我使用相同版本的 SQL Server Management 这样做工作室 2014。
我将两台机器的 IP 添加到 Azure SQL DB 防火墙规则中。
VM 上的防火墙已关闭。
我的笔记本电脑与 Win10 完美连接,但每当我在装有 Windows Server 的 VM 上时,我的 SSMS 中都会收到此消息:
Connect to Server
Cannot connect to <my_database>.database.windows.net.
ADDITIONAL INFORMATION:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.) (Microsoft SQL Server, Error: 10061)
No connection could be made because the target machine actively refused it
我应该如何使用 Windows Server 从我的 VM 连接到该数据库?我在 Google 上搜索了很多,尝试了一些方法,例如为 TCP/UDP/端口的 Windows Server 防火墙添加出站规则,并在 SSMS 中尝试不同的协议,但我现在没有想法。
【问题讨论】:
-
您能否从 VM ping (ping -a) 您的 SQL Azure 服务器?如果成功,您是否能够使用从 ping 命令收到的 IP 地址远程登录您的 SQL Azure 服务器?远程登录 IP 1433
-
@AlbertoMorillo 如何 ping 我的 SQL Azure 服务器?我只是尝试在命令提示符下运行
ping <server>.database.windows.net,但它在两台机器(VM 和笔记本电脑)上返回Pinging westeurope1-a.control.database.windows.net [some_IP] with 32 bytes of data:,然后返回Request timed out4 次 .返回消息的最后一行是Ping statistics for <IP>: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
标签: sql-server virtual-machine azure-sql-database ssms windows-server-2012-r2