sql-server - netsh 端口代理并不总是适用于 SQL Server
问题描述
我有一台在 Parallels 中运行 Windows 10 21H1 的 Mac。在 macOS 上,我在 Docker 容器中运行 SQL Server,暴露在端口 55556 上。在 Windows 中,我试图将 localhost,55555 转发到 Docker 中的 SQL Server。
为此,我尝试netsh interface portproxy add v4tov4 listenaddress=localhost listenport=55555 connectaddress=10.211.55.2 connectport=55556
了,但这仅在 DataGrip 中连接时有效(在 Windows VM 中,使用 JDBC 驱动程序);我可以看到所有的数据库,查询它们等
。SQL Management studio 总是给出以下错误:
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 - The wait operation timed out.) (Microsoft SQL Server, Error: 258)
SQL Management Studio 使用的驱动程序是否存在忽略此端口转发的内容?
解决方案
我想通了:监听地址为 localhost 的 portproxy 不起作用,但 127.0.0.1 可以。
推荐阅读
- r - 使用刷牙和缩放时,Shiny 应用程序中的 DT 表上缺少搜索框
- javascript - 使用局部变量为循环中的元素设置 onclick 方法,而不立即激活它
- javascript - 什么是列表?【JavaScript面试题】
- html - 如何使用 flexbox 沿 x 轴弯曲盒子
- python - 如何通过文本序列上的关键字创建自定义一种热编码
- vue.js - UI 不响应/状态更新后不重新呈现
- css - Odoo:如何编辑发票/报价布局 CSS
- mysql - MySQL JOIN 与两个表并使用 IFNULL。结果因 MySQL 版本而异
- amazon-web-services - S3 返回已删除对象的公共前缀
- mysql - 如何在 Mysql docker 容器中设置 MYSQL_PS1