[英]Connect to SQL Server in local machine (host) from docker using host.docker.internal
I'm trying to connect to my SQL Server instance running in my local computer using host.docker.internal
(as recommended in https://docs.docker.com/docker-for-windows/networking/#use-cases-and-workarounds )我正在尝试使用
host.docker.internal
连接到在本地计算机上运行的 SQL Server 实例(如https://docs.docker.com/docker-for-windows/networking/#use-cases-and 中推荐的那样) -解决方法)
The host.docker.internal
is successfully resolved to an IP, and it's ping-able host.docker.internal
已成功解析为 IP,并且可以 ping 通
And I've opened up the port 1433 in my firewall configuration我在防火墙配置中打开了端口1433
Error message错误信息
Connection refused 192.168.65.2:1433
连接被拒绝 192.168.65.2:1433
My connection string我的连接字符串
Data Source=host.docker.internal,1433;Initial Catalog=;Persist Security Info=False;User ID=;Password=;MultipleActiveResultSets=True;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
Data Source=host.docker.internal,1433;Initial Catalog=;Persist Security Info=False;User ID=;Password=;MultipleActiveResultSets=True;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
docker version码头工人版本
Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:12:48 2018
OS/Arch: windows/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:22:38 2018
OS/Arch: linux/amd64
Experimental: true
Docker for windows version Docker for windows 版本
If anyone have similar problem, here's how I solve it如果有人有类似的问题,这就是我解决它的方法
If it's still not working, there are a few more things to check如果它仍然无法正常工作,还有一些事情需要检查
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.