如何授予自己对本地 SQL Server 实例的管理员访问权限? [英] How do I grant myself admin access to a local SQL Server instance?

查看:39
本文介绍了如何授予自己对本地 SQL Server 实例的管理员访问权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地机器上安装了 SQL Server 2008 R2.但是,由于权限(或缺乏),我无法创建新数据库.

I installed SQL Server 2008 R2 to my local machine. But, I can't create a new database because of rights (or lack of).

创建数据库权限被拒绝"

"CREATE DATABASE PERMISSION DENIED"

因此,我尝试将管理员权限分配给我当前的登录名

So, I tried to assign the admin privileges to my current login

用户无权执行此操作."

"User does not have permission to perform this action."

我还尝试创建一个具有管理员权限的新登录名,但没有成功.我如何授予自己管理员权限以便我可以创建数据库?我可以重新安装,但我不想这样做.

I also tried to create a new login that would have admin privileges but with no luck. How do I grant myself admin rights so that I can create a database? I can re-install, but I prefer not to.

推荐答案

是的 - 在安装 SQL Server 时,您似乎忘记将自己添加到 sysadmin 角色.如果您是机器的本地管理员,这篇博文 可以帮助您使用 SQLCMD 将您的帐户加入 SQL Server 系统管理员组,而无需重新安装.如果你问我,它是 SQL Server 中的一个安全漏洞,但它会在这种情况下帮助你.

Yes - it appears you forgot to add yourself to the sysadmin role when installing SQL Server. If you are a local administrator on your machine, this blog post can help you use SQLCMD to get your account into the SQL Server sysadmin group without having to reinstall. It's a bit of a security hole in SQL Server, if you ask me, but it'll help you out in this case.

这篇关于如何授予自己对本地 SQL Server 实例的管理员访问权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆