docker容器部署项目和SqlServer数据库后,执行初始化数据库命令报错,这是为什么呢
来源:18-3 容器化部署.NET Core API

精慕门917180
2021-07-22
windows10
sqlserver数据库和改完虚拟ip的项目已部署到docker容器中,这时候数据库初始化执行命令Update-Database -context AppDbContext报错: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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
报错后我按网上提供的资料修改sql server configuration Manager->sql server 网络配置->SqlExpress->TCP/IP(已启用)->TCP/IP属性中IPALL下TCP端口已经改成1433,最后重启了SQL Server(SQLEXPRESS)服务,最终还是报错,这是为什么呢
2回答
-
阿莱克斯刘
2021-07-30
你之前是否有在电脑中安装过sql server?如果有,那有可能1433端口冲突了
012021-08-02 -
阿莱克斯刘
2021-07-24
你有没有使用下面的命令查找 sql server 在docker内部所对应ip地址?
docker inspect bridge
相关内容载课程18-3视频最后的部分有详细讲解
022021-07-24
相似问题