在我的开发车间,我们在位于远程网络上的虚拟服务器上部署代码。
我们首先打开与网关服务器的 SSH 连接,然后通过本地端口通过 SSH 隧道 RDP 访问该网络上的机器。
我非常希望能够以相同的方式本地访问在这些服务器上运行的 SQL Server 实例。
我设置了一个本地端口 (3398) 以重定向到远程实例上的 SQL Server 端口 (L3398 -> remote.machine.com:1433)。
然后我可以通过远程登录到 localhost 3398 来实际测试连接,我得到了一个连接:屏幕清除,我可以在一些监听过程中输入字符。
但是当我尝试将 SSMS 连接到 localhost:3398 时,它会超时,然后声称没有 SQL Server 在该端口上侦听:
Cannot connect to localhost:3398
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. (...)
我确信服务器接受远程连接,因为我在通过 RDP 登录到远程网络中的另一台机器时已经远程连接到它。
我用谷歌搜索知道这是可能的;有谁知道为什么这不起作用,或者我可以做些什么来诊断并希望解决问题?
谢谢!