1

I have configured docker with db on it

Here is how I download sql

docker pull microsoft/mssql-server-linux:2017-latest

Then I do this command

docker run -e "ACCEPT_EULA=Y" -e  'SA_PASSWORD=$cthulhu1988' -p 1433:1433 --name test -d microsoft/mssql-server-linux:2017-latest

and then I tried to connect to it via this command

docker exec -it test /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '$cthulhu1988'

But I get this error

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

UPDATE

I make ipconfig And tried to do this with my Ipv4 address

docker exec -it test /opt/mssql-tools/bin/sqlcmd -S 10.0.75.1 -U SA -P '$cthulhu1988'

Now I have this errors

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired. Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x102. Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..

I Cheched, tcp\ip enabled

Where can be my mistake?

1
  • So you solved the password issue, even though I still don't agree it is a complexity issue (swap out $ for # for example). Now remove the goose chase about password complexity from your question and let's focus on the problem you haven't solved yet. Commented Sep 12, 2019 at 13:08

2 Answers 2

1

Your password does not appear to be the issue. I connected just fine and can't recreate the issue. Change your port mapping and try again:

docker run -e "ACCEPT_EULA=Y" -e  'SA_PASSWORD=$cthulhu1988' -p 1488:1433 --name test -d microsoft/mssql-server-linux:2017-latest
Sign up to request clarification or add additional context in comments.

Comments

1

In my case, the password "$cthulhu1988" does not pass complexity validation. Instead of receiving an error, the container starts without any sign of an error. However, I can then no longer login as SA.

I stopped and removed my container, then re-created it with "docker run" but this time I changed the password to

1Secure*Password1

Now having a complexity-valid password, finally I am able to log in as SA.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.