简体   繁体   中英

Connect to SQL Server Express running inside a container from SSMS

I am trying to connect to an instance of SQL Server Express running inside a container from SSMS running on my host machine.

The container was started as follows:

docker pull microsoft/mssql-server-windows-express
docker run -d -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=password" -p 1436:1433 --name mydb microsoft/mssql-server-windows-express

The container is running on the IP address that I got using

docker inspect --format '{{.NetworkSettings.Networks.nat.IPAddress}}' mydb

Now I am trying to connect to this instance, at the above IP address using SSMS, but get the following error:

在此处输入图片说明

I get the same error even if I change the case/position of the instance, eg 1.2.3.4,1436\\SQLExpress , or 1.2.3.4\\SQLExpress,1436 .

What am I missing?

Possible duplicates:

  1. Cannot connect to SQL Server express from SSMS
  2. Connect to SQL Express with SSMS

But the answers didn't help me.

  • I have made sure that the container is up and running. I can ping to the IP address of the container.
  • The username and password are correct.

One thing I could be missing is that the SQL Server authentication is not enabled on the database instance in the container. I am not sure how to do that.

How can I connect to the SQL Server Express instance running inside a container from SSMS?

The original password I had used was weak (no I wasn't using password used in the question, but a different one which was still weak).

After starting a new container with a password which has combinations of uppercase, lowercase, characters, and numbers, I can now log into the database using following settings.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM