Tuesday, 16 July 2013

forgot sa password and no logins are added

Stop the SQL services
Edit the properties of the SQL Service
Change the startup parameters of the SQL service by adding a –m; in front of the existing parameters

  • Start the SQL services. These are now running in Single User Mode.
  • Start CMD on tthe SQL server
  • Start the SQLCMD command.

    • Now we create a new user. Enter following commands
      • CREATE LOGIN recovery WITH PASSWORD = ‘TopSecret 1′ (Remember SQL server has default strong password policy
      • Go
        • Now this user is created
    • Now we grant the user a SYSADMIN roles using the same SQLCMD window.
      • sp_addsrvrolemember ‘recovery’, ‘sysadmin’
      • go

No comments:

Post a Comment