microsoft / mssql-docker

Official Microsoft repository for SQL Server in Docker resources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Login failed for user 'sa' after logoff

zMcKracken opened this issue · comments

I have installed mssql docker image on my centos box with this command, I'm logged as root:

docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=Pwd12345$$" -p 1433:1433 --name sql1 -d mcr.microsoft.com/mssql/server:2022-latest

Everything goes smooth, then I try to login with this command:

/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P Pwd12345$$

And again everything is ok, I can create DB and other things.
Now the weird thing is that if I close my ssh session, and reopen it then I cannot log in using the same exact command, and I got the usual error message:

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

From the docker logs I see this:

2023-03-16 09:56:49.71 Logon Login failed for user 'sa'. Reason: Password did not match that for the login provided. [CLIENT: XXXXXX]

thanks you for any kind advice