zoukankan      html  css  js  c++  java
  • reset sql server express sa password

    sql server 2005 express edition does not supplied enterprise manager , and in some case you have to use sa a to  connect to sql server express. and here is the solution.

    in default installation , authorization method can't be set and the default authorize method is trusted connection with your windows account.

    you need some steps to use sa and chang its password , lets go:

    first , open your registry , changing the authorize method with mixed way which can be find in registry , (open run >regedit ) , find loginMode key under HKLM/software/microsoft/.../MSSQL/..  ,change it's value from 1 to 2

    restart the sql express service ,and this is important


    second , in command prompt , direct to you sql server folder : (like c:\program files\microsoft sqlserver express\bin) , and then type

    c:\program files\microsoft sqlserver express\bin> sqlcmd -E -S .\SQLEXPRESS
    and then return the >prompt
    and then type the follows commands
    >sp_password @new='your_sa_pass',@loginame='sa'
    >go
    >alter login sa enable
    >go
    >alter login sa with password='your_sa_pass' unlock
    >go
    >exit


    if there is no error occurred , your sql server express password has been changed

    so the last step is to test the sa account

    osql -U sa -S .\SQLEXPRESS
    and then enter your new sa password

    note: .\sqlexpress can be replace with your computer name

    good luck
  • 相关阅读:
    find 以及linux 和windows 文件互传
    27 关于Object类 -- equals()
    26 super关键字
    25 访问修饰符限定词
    24 继承 子类中方法重写
    23 static 关键字
    22 包(package)来解决不同包下同名文件的冲突问题
    21 封装(get,set方法)
    20 带参构造方法(this关键字)
    19 无参构造方法
  • 原文地址:https://www.cnblogs.com/guojin705/p/1800777.html
Copyright © 2011-2022 走看看