Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to the MSSQL Docker container using a different port than 1433?

I'm able to run the MSSQL container easily enough using the instructions from Microsoft

The issue is that because of the a locally running instance of MSSQL, I can't use port 1433.

I've changed the startup line to use 30303:1433, but I'm unable to connect to the instance at localhost:30303.

Connecting to the container, I'm able to connect to the instance using the tutorial's command:

/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "<YourNewStrong@Passw0rd>"
like image 319
Dan Avatar asked Oct 17 '25 13:10

Dan


1 Answers

Ok found the solution myself. It is just due to a SQL quirk.

Changing the address to 127.0.0.1,30303 works.

  • Use a comma
  • Don't use localhost; use 127.0.0.1 instead.
like image 152
Dan Avatar answered Oct 20 '25 04:10

Dan



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!