Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the default SQL Server credentials created via docker?

Tags:

sql-server

I'm trying to set up a SQL Server on my raspberry with Ubuntu server 20.04. I've followed both a tutorial and the Microsoft documentation and it runs pretty well.

I've finally run this command :

sudo docker run -e 'MSSQL_PID=developer' -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=XXXX' -p 1433:1433 --name azuresqledge -h azuresqledge -d mcr.microsoft.com/azure-sql-edge:latest

I assumed the login would be "developer" and the password "XXX" but it turns out it's not working (Login failed, err n.18456). I tried to access the SQL Server from my computer with SQL Server Management Studio, but it refuses the connection telling me that the credentials are wrong. What can I do?

I also tried with the login "azuresqledge" in doubt, but without result.

Thanks for your help !

like image 365
A.Rey Avatar asked May 13 '26 14:05

A.Rey


2 Answers

The environment variable MSSQL_SA_PASSWORD specifies the password for the sa account. The MSSQL_PID environment value is unrelated an account; it specifies the SQL Server product edition (Developer edition here).

You can provision other accounts after starting the container by connecting with the sa login and executing statements to create logins, database users, etc.. Alternatively, use the SSMS Object Explorer graphical interface for same.

CREATE LOGIN developer WITH PASSWORD = 'password1';
like image 176
Dan Guzman Avatar answered May 15 '26 05:05

Dan Guzman


To expand on Dan's answer above which helped me discover the following...

If you need to use a specific login with a password that doesn't meet the requirements, you can turn off the policy like this:

create login admin with password = 'admin', check_policy = off

and if you want it to have sa permissions...

exec master..sp_addsrvrolemember @loginame = 'admin', @rolename = 'sysadmin'
like image 33
Eric Bynum Avatar answered May 15 '26 04:05

Eric Bynum