为什么我无权更改此 SQL Server Express 2005 密码?
我可以访问 SQL 2005 Express 的安装。可能是我前段时间自己安装的。但有一段时间没有使用它了。
我尝试通过通常用于此类本地安装的“sa”密码来访问此实例。
然而这个密码不起作用。
我仔细检查了混合模式身份验证是否已设置并且 sa 用户是否存在。
我可以通过 Windows 身份验证访问该实例并查询数据库(甚至是主数据库)。没问题。
然后我尝试使用此 sql 重置 sa 密码:
ALTER LOGIN sa WITH PASSWORD = 'MyNewPassword';
它立即失败并出现以下错误:
Cannot alter the login 'sa', because it does not exist or you do not have permission.
那么为什么我的本地 Windows 用户无权执行此操作?
I have access to an installation of SQL 2005 Express. I probably installed it myself some time ago. But haven't used it in a while.
I tried to access this instance via an 'sa' password I typically use for such local installs.
However this password did not work.
I double checked that mixed mode authentication is setup and that the sa user exists.
I can access the instance via windows authentication and query the heck out of the DB's (even master). No problem.
Then I tried to reset the sa password using this sql:
ALTER LOGIN sa WITH PASSWORD = 'MyNewPassword';
It promptly fails with this error:
Cannot alter the login 'sa', because it does not exist or you do not have permission.
So why does my local Windows user not have permission to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否按照这些步骤操作?
您是否已登录作为最初安装该服务的同一管理员用户,还是本地管理员?能够阅读是一种许可级别。能够更改数据,尤其是服务器级对象是另一组权限。仅仅因为你能读并不意味着你就能写。
如果使用不同的管理员登录失败,您始终可以使用 恢复工具
Have you followed these steps?
Are you logged in as the same admin user who installed the service in the first place, or local admin? Being able to read is one level of permission. Being able to change data and especially server-level objects is another set of permissions. Just because you can read does not mean you're going to be able to write.
If using different admin logins fails, you could always hack your sa password with a recovery tool
我知道这是一篇较旧的帖子,但我在寻找自己问题的答案时仍然找到了它。
这里有 2 个选项:
PSExec 选项 1:(来自博客文章)
C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Binn
SQLCMD –S <服务器名称\实例名称>
SQLCMD -S SPExternal\Sharepoint
- 我的计算机名称\数据库实例名称最后,通过反转上述最初 4 个步骤,使服务器退出单用户模式。使用新登录名进行连接。
选项 2:使用 PSExec 以 NT 身份登录Authority\System
PsExec -s -i "C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Ssms.exe"
选项 2 是 最初在此 DBA SE 答案中引用 - 感谢找到它的人。
I know that this is an older post, but I still found it while searching for an answer to my own question.
2 options here:
Option 1: (from blog post)
C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Binn
SQLCMD –S <Server_Name\Instance_Name>
SQLCMD -S SPExternal\Sharepoint
- my machine name \ database instance nameLastly, take the server out of single user mode by reversing the initial 4 steps outlined above. Connect using the new login.
Option 2: Use PSExec to login as NT Authority\System
PsExec -s -i "C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Ssms.exe"
Option 2 was originally referenced in this DBA SE answer - thanks to the person who found it.