Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

986
Visualizações
Connecting to SQL Server Express from within Docker Container gives an error occurred evaluating the password

I am trying to run a docker container from the Microsoft SQL Server Express image (https://hub.docker.com/r/microsoft/mssql-server-windows-express/)

For example I've tried the following commands (I'll use the -d flag once I've got it working)

docker run -it -p 1433:1433 -e SA_PASSWORD=Mfp_4871nJUj_1-23H -e ACCEPT_EULA=Y --name to_delete_1 microsoft/mssql-server-windows-express powershell.exe
docker run -it -p 1433:1433 -e 'SA_PASSWORD=Mfp_4871nJUj_1-23H' -e 'ACCEPT_EULA=Y' --name to_delete_1 microsoft/mssql-server-windows-express powershell.exe

(not the real password - I've tried many passwords since one of the suggestions for fixing the error I see below is to ensure that the password meets Microsoft's password policy. However for all passwords I get the same error)

I've also tried lower case sa_password

However, each time I try to connect with the sa account from within the container using any of

sqlcmd -U sa -P Mfp_4871nJUj_1-23H
sqlcmd -S localhost -U sa -P Mfp_4871nJUj_1-23H
sqlcmd -S localhost\sqlexpress -U sa -P Mfp_4871nJUj_1-23H
sqlcmd -U sa
sqlcmd -S localhost -U sa
sqlcmd -S localhost\sqlexpress -U sa

(entering password for last 3)

I get

Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login failed for user 'sa'..

Looking at the SQL Server logs it shows

2017-03-13 21:25:52.32 Logon       Error: 18456, Severity: 14, State: 7.
2017-03-13 21:25:52.32 Logon       Login failed for user 'sa'. Reason: An error occurred while evaluating the password. [CLIENT: 172.22.251.6]

The main advice is to ensure the password meets SQL Server's password criteria but I think all of the passwords I've tried do.

I run Docker on Windows 10 Enterprise (build 14393.693). I have Docker for Windows Version 17.03.0-ce-win1 (10300).

What do I need to do to be able to connect to SQL Server from within the container using the microsoft/mssql-server-windows-express Docker imamge?

Thanks

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I don't know if you ever found the answer to this question. I have not tried connecting to the database from within the container, but I have connected to it from SSMS from outside the container. The key for me was to specify the password in double quotes in the original command. The final command looked like this:

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

I was then able to connect to it through SSMS. Get the IP address from the docker container using:

docker inspect

Then log in to the database through SSMS like this:

SSMS Login info

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda