简体   繁体   中英

Can't connect to ms sql database from docker container by sql management studio

I try to run a microsoft/mssql-server-windows-express container ->

docker run -d -p 1433:1433 -e sa_password=password -e ACCEPT_EULA=Y microsoft/mssql-server-windows-express

And I get next error ->

docker: Error response from daemon: failed to create endpoint hopeful_kowalevski on network nat: HNS failed with error : The process cannot access the file because it is being used by another process.

I think it is because sql server on my environment listens to 1433 port. Then I try to run container with other port eg 5000:1433 and container is run well.

Then I try to connect to db from container by sql management studio using "ip-address",5000. But I get Microsoft SQL Server, Error: 258.

在此处输入图片说明

As far as I understood, the issue was with an incorrect password to DB. The password didn't match to database rules. The correct password should contain

at least 8 characters long and contain characters from three of the following four sets: Uppercase letters, Lowercase letters, Base 10 digits, and Symbols -> https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-2017&pivots=cs1-bash#pullandrun2017

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