views:

164

answers:

2

i have one database in ms sql server 2005.

i create this long time back, now want to modify it but i lost the password, i remember the user name for that database, is there any way to recover the password for that database or

change its password ?

Thanks

+1  A: 

Databases don't have passwords. You may be talking about:

  • the password of a database master key, certificate or other cryptographic key encrypted by password
  • the password of a SQL Server login
  • the password of database backup media

None of these can be recovered if lost. The only one that can be brute forced is if you lost access to a SQL instance, see How to add a Windows user to the sysadmin fixed server role in SQL Server 2005 as a failure recovery mechanism

Remus Rusanu
A: 

You can use command prompt to change sql server password.

Osql -S yourservername -E

1> EXEC sp_password NULL, 'yourpassword', 'sa'

2> GO