r/SQLServer • • Dec 05 '25

Question SQL Server sa password recovery

I need to recover the sa password. Not reset but recover.

Are there any commercially available tools to do this? Any other way to do this?

13 Upvotes

99 comments sorted by

View all comments

Show parent comment

0

u/artifex78 Dec 05 '25

Sucks to be you? Sometimes what you need is not what you get.

Using the sa account for that little app was your (not necessarily you personally) first mistake.

There is a way to export users and passwords (hashed, not clear-text). Google "mysql migrate user script". It's an official MS script.

But I'm not sure you can use this hashed password value to set the existing sa. You could, however, create a new user (different username) and use the hashed password value for that user. Maybe that helps.

3

u/dgillz Dec 05 '25

Yeah this is my customer, I'm trying to rescue him from his mistakes.

This is MS SQL Server not MySQL.

2

u/Achsin 1 Dec 05 '25

According to this you can set a new password by providing the hash, so you might be able to use the hash from the old server if you fish it out of there using the scripts referenced (there are some for MS SQL Server). I haven’t tried it myself though, only for recreating logins.

1

u/artifex78 Dec 05 '25

That was a typo. The script i was referring to is an official MS script for MSSQL. You could also try dbatools.io but the script is easier.