I’m trying to connect to a SQL Server Docker container via SQL Server Management Studio, but it doesn’t work. When I attempt to connect, I get this error:
Login failed for user ‘sa’. (Microsoft SQL Server, Error: 18456)
I run the container with this command:
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=yourStrong(!)Password"
-p 1433:1433 --name=bd_sql_server
-d mcr.microsoft.com/mssql/server:2022-latest
Here is the info I provided in the "Connect to server" window in SSMS:
"Connect to server" window in SSMS
and the container running in Docker Desktop:
Container running in Docker Desktop
I made sure that the password was the same I specified.
I can’t seem to find what I’m doing wrong. Can you help me?
Thanks.
2
Answers
@MathisMahaux
hi Mathis, Charlie here
probably you have a windows desktop version of MSSQL and you forgot to stop the local service before connecting to the docker version.
good Luck !
Test that the SQL server is assecible within container
if you can connect to the SQL command line , than there is the problem with the MSSQL configuration and network setting