Reset password for SQL server on Centos 7

I have a development instance of mssql that I keep forgetting the damn password on.

It sure is a good thing it's easy to reset :) Run the following commands as root.

# stop mssql-server
systemctl stop mssql-server

# set sa password:

[root@ms-sql ~]# /opt/mssql/bin/mssql-conf set-sa-password
Enter the SQL Server system administrator password: 
Confirm the SQL Server system administrator password: 
Configuring SQL Server...

ForceFlush is enabled for this instance. 
ForceFlush feature is enabled for log durability.
The system administrator password has been changed.
Please run 'sudo systemctl start mssql-server' to start SQL Server.

# start server
systemctl start mssql-server

Now you should be able to connect like so:

sqlcmd -S <SQLInstanceName>-U <UserName> -P <Password>
comments powered by Disqus