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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM