The SA account is a system administrator on the SQL Server instance that's created during setup. After you create your SQL Server container, the MSSQL_SA_PASSWORD environment variable you specified is discoverable by running echo $MSSQL_SA_PASSWORD in the container. For security purposes, change your SA password:
-
Choose a strong password to use for the SA user.
-
Use
docker execto run the sqlcmd utility to change the password through a Transact-SQL statement. Replace<YourStrong!Passw0rd>and<YourNewStrong!Passw0rd>with your own password values:sudo docker exec -it sql1 /opt/mssql-tools/bin/sqlcmd \ -S localhost -U SA -P '<YourStrong!Passw0rd>' \ -Q 'ALTER LOGIN SA WITH PASSWORD="<YourNewStrong!Passw0rd>"'
docker exec -it sql1 /opt/mssql-tools/bin/sqlcmd ` -S localhost -U SA -P "<YourStrong!Passw0rd>" ` -Q "ALTER LOGIN SA WITH PASSWORD='<YourNewStrong!Passw0rd>'"