Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 978 Bytes

File metadata and controls

17 lines (13 loc) · 978 Bytes

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:

  1. Choose a strong password to use for the SA user.

  2. Use docker exec to 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>'"