SSMS如何区分SQL Server在Docker中和主机上的SQL Server之间的区别?

huangapple go评论50阅读模式
英文:

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?

SSMS如何区分SQL Server在Docker中和主机上的SQL Server之间的区别?

SSMS如何区分SQL Server在Docker中和主机上的SQL Server之间的区别?

答案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.

huangapple
  • 本文由 发表于 2023年5月30日 00:49:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76359056.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定