Theme Graphic
Theme Graphic

sql server password recovery

the ways to reset sql password you have forgot or lost on ms sql server
Posted on Thursday, January 07, 2010 at 1:48 AM

How to reset 'sa' password if SQL Password is lost/forgotten/unknown?


How to reset 'sa' password if SQL Password is lost/forgotten/unknown?



First off, you can log in as any SSO role user and have them reset the 'sa' password for you.

Being life and life being not always so simple we may not always have an SSO role handy (or configured)

So, we resort to the following:
  1. Edit the ‘runserver' file. By default it's in the $SYBASE_HOME/install directory
  2. Add "-psa" (for password 'sa') to the end of the command line. (I have noticed that this DOES NOT work in windows unless it's the FIRST param on the command line)


  3. Save file and reboot server. You ‘may' have to use Unix ‘kill' or Windows ‘End Task' but I suggest that as a last resort.
  4. While server is restarting, watch the console. You will see something like. "New SSO Password for sa:akshentneksla". If you miss it in the console, check the error logs. It will also be written there.
  5. Re-Edit the runserver file once the server has ‘booted' and remove the "-psa". If you don't, the next time the server is restarted it will RESET the sa password again and you're screwed all over.
  6. Login as 'sa' using the new password (In this case: akshentneksla).
  7. use sp_password to change the password to something you will remember.
  8. (OPTIONAL) reboot server to make sure all is nice and neat. (See Note #2 below!).Some Notes:1- People have claimed that they are still not able to login with this new password. If that is the case make sure that the 'sa' account is not locked. You can do this by setting a TRACEFLAG to "4044″. This is a boot time traceflag that allows 'sa' to login even if his/her account is locked.

    2- Windows services do not always call the proper .bat file when they startup your service. What happens is that you may edit the ‘runserver' .bat file and yet not have your password reset if you stop/start the service. This is because the sybase installer references the 'sqlsvr.exe' executable with parameters DIRECTLY.(I have not, as of this writing been able to figure out how to change this.) So, stop the service, do all the edits/steps I mention abov, but make sure you take STEP 8 and restart the server VIA THE SERVICES WINDOWS, then you will be sure that your server will start properly on subsequent executions.


Reference: http://blog.passwordunlocker.com/how-to-reset-sa-password-if-sql-password-is-lostforgottenunknown/
Bookmark: Submit To Digg Submit To reddit Submit To del.icio.us Bookmark With StumbleUpon Bookmark With FaceBook Bookmark With Google Bookmarks   Share: Share By Email By Email

0 comments on "How to reset 'sa' password if SQL Password is lost/forgotten/unknown?"
No comments posted yet.

Leave A Comment
Subject:


Comment:
   Bold Italic Underline          Code Link Image Horizontal Rule


Because you do not have or are not logged in to your Programmer's Heaven account, please enter your name.

Name:


To help prevent comment SPAM, please enter the magic code '514' in the box:




Posting Rules
Please follow these rules when posting comments on blog posts.
  • Do not post anything that is racist, hate speech or of a sexual or adult nature.
  • Do not post or link to anything that infringes copyrighted laws.
  • Posting about security or legal topics is fine so long as you are not glorifying or encouraging people to perform illegal activities.
  • Both the author of this blog and the Programmer's Heaven administrators may delete any inappropriate comments without notice at their own discretion.
 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.