docker 容器连接 host的sql server失败

报错内容::“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: 40 - Could not open a connection to SQL Server)”

解决方式:打开sql server configuration manager(数据库配置管理器),如下图

 

启用 TCP/IP 协议,然后重启sql server 服务,就可以了。

 

 

找不到数据库配置管理器的话可以参照该文章:SQL Server Configuration Manager

 

posted @ 2019-10-11 09:45  富贵东坡  阅读(1421)  评论(0编辑  收藏  举报