How to change MSSQL sa password

In fist time you must admin acces to Windows server.

Then go to the cmd.exe and run next commands:

C:\Program File...\MSSQL\Binn> net start MSSQL$<INSTANCE> /m"SQLCMD"
   NET START
   service succesfully started

C:\Program File...\MSSQL\Binn> sqlcmd -S <SERVERNAME>\<INSTANCE>
1> CREATE LOGIN mylogin WITH PASSWORD='mypassword'
2> GO
3> SP_ADDSRVROLEMEMBER mylogin, SYSADMIN'
4> GO
5> exit

C:\Program File...\MSSQL\Binn> net stop MSSQL$<INSTANCE>
  NET STOP
  service

 

Thats all.

Leave a Reply

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