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 the service

[code]
stop mssql-server
systemctl stop mssql-server
[/code]

set sa password:

[code]
[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.
[/code]

start server

[code]
systemctl start mssql-server
[/code]

Now you should be able to connect like so:

[code]
sqlcmd -S SQLInstanceName -U UserName -P Password
[/code]

Leave a Reply

Your email address will not be published. Required fields are marked *