You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

安装本地MSSQLSERVER实例后Docker容器启动失败,报0x2749错误

问题描述

此前通过Docker Desktop运行MSSQL数据库共享镜像容器一切正常,昨日为其他项目安装Microsoft SQL Server并创建本地实例后,今日重启Docker容器时出现端口冲突报错。修改本地MSSQL实例端口后,容器仍反复报错,运行3-5分钟后自动停止,尝试连接容器内数据库也失败。

容器启动错误日志

2023-04-14 11:26:36 not ready yet...
2023-04-14 11:26:36 Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
2023-04-14 11:26:36 Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2749.
2023-04-14 11:26:36 Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..

连接容器时的错误提示

The TCP/IP connection to the host localhost, port 1433 has failed. Error: "The driver received an unexpected pre-login response. Verify the connection properties and check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. This driver can be used only with SQL Server 2005 or later.

已执行的排查操作

  • 排查防火墙配置
  • 检查WSL相关设置
  • 重建Docker容器
  • 停止所有本地MSSQL实例

启动容器使用的Docker命令

docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=SomePassword123$" -p 1433:1433 --name [dbName] --hostname [dbName] -d [registryLoginURL]/[imageName]:[imageVersion]

内容的提问来源于stack exchange,提问作者Antonio Verlinghieri

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 18:33:33