/opt/mssql-tools18/bin/sqlcmd -S localhost,1433 -U sa -P k$bBE833
However, I received the following error:
Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server: Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server: TCP Provider: Error code 0x2749.
Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server: A network-related or instance-specific error has occurred while establishing a connection to localhost,1433. Server is not found or not accessible.
I’ve been struggling with this issue for days. Any help would be greatly appreciated. Thank you!
If you had studied the image, you would have noticed that the entrypoint script starts whatever command is provided. Since you choose to replace the default command /opt/mssql/bin/sqlservr with tail -f /dev/null. the sql server is not started.
Furthermore, the $ in your password requires single quoting, otherwise it prints out the value of the variable $bBE833,. If this variable does not exist, your password is just k.
Note: I also removed -d as it makes it unnecessarily harder if the container is started in detached mode. I also added --rm so the container is deleted when stopped.
Update: my bad, it does. The reason is the $ in your password:
2025-04-24 19:31:57.34 spid19s ERROR: Unable to set system administrator password: Password validation failed. The password does not meet SQL Server password policy requirements because it is too short. The password must be at least 8 characters..
Thank you. I’ve encountered a new problem: ‘sqlservr: This program requires a machine with at least 2000 megabytes of memory.’ I’m trying to install a SQL Server container on DigitalOcean.com, but I only have 254MB available. Is there a way to install the SQL Server container?