Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

enter image description here

like image 362
agawa17 Avatar asked Apr 24 '26 23:04

agawa17


1 Answers

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://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-2017&pivots=cs1-bash#pullandrun2017

like image 114
agawa17 Avatar answered Apr 27 '26 13:04

agawa17



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!