英文:
How did SSMS know the difference between SQL Server in Docker and host SQL Server?
问题
I'm running Docker on my Windows 11 host machine.
我在我的Windows 11主机上运行Docker。
I created a container with following:
我创建了一个容器,其中包括以下内容:
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=yourStrong(!)Password" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=yourStrong(!)Password" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest
I have SSMS and SQL Server 2022 installed on host machine. Wouldn't this be considered localhost port 1433? Yet I can access both Docker version and host version of SQL Server.
我在主机上安装了SSMS和SQL Server 2022。这不应该被视为本地主机的端口1433吗?但我可以访问Docker版本和主机版本的SQL Server。
Can someone help me understand how I am able to access both instances when I'm thinking both should be considered localhost 1433?
有人可以帮助我理解为什么我可以访问这两个实例,而我认为它们都应该被视为本地主机的1433端口吗?
英文:
I'm running Docker on my Windows 11 host machine.
I created a container with following:
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=yourStrong(!)Password" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest
I have SSMS and SQL Server 2022 installed on host machine. Wouldn't this be considered localhost port 1433? Yet I can access both Docker version and host version of SQL Server.
Can someone help me understand how I am able to access both instances when I'm thinking both should be considered localhost 1433?
答案1
得分: 1
"Developer Edition和Express Edition在Windows上默认情况下关闭了TCP/IP,因此不会监听端口1433。无论如何,配置管理器和SQL Server ERRORLOG都会告诉您一个实例正在监听哪些网络协议和端口。从您发布的截图中,您可以看到只有一个实例在监听端口1433。"
英文:
>how I am able to access both instances when I'm thinking both should be considered localhost 1433?
Developer Edition and Express Edition on Windows have TCP/IP turned off by default, so wouldn't be listening on port 1433.
In any case Configuration Manager and the SQL Server ERRORLOG will both tell you what network protocols and ports an instance is listening on. From the screenshots you posted you can see that only one of the isntances is listening on port 1433.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论