SQL Server - 使用“sysadmin"创建新的登录帐户来自没有“系统管理员"的帐户的角色角色 [英] SQL Server - Creating a new login account with "sysadmin" role from an account without "sysadmin" role
问题描述
我的 sql 数据库有 2 个帐户.
My sql database has 2 accounts.
第一个帐户是 sa
第二个帐户是 user
两个帐户都启用了 sysadmin
角色.
Both account has sysadmin
role enabled.
我们已经忘记了 sa
我们只知道user
不知何故,有人删除了 user
的 sysadmin
角色.
Somehow someone remove sysadmin
role for user
.
现在我需要一个具有 sysadmin
角色的帐户.
Now I need an account with sysadmin
role.
我怎样才能做到这一点?
How can I achieve that?
我无法更改 sa
的密码,因为某些网站可能使用 sa
帐户连接到数据库.
I cannot change the password for sa
as some websites might be using sa
account to connect to the database.
因此,我最好的解决方案是通过任何必要的方式创建一个具有 sysadmin
角色的新帐户.
So, my best solution is to create a new account with sysadmin
role by any means necessary.
推荐答案
[被私下催促将我的评论转换为答案.]
[Was prodded privately to convert my comment to an answer.]
您需要列举可能使用 sa 的网站并阻止他们这样做.然后修改sa密码如下:
You need to enumerate the web sites that might be using sa and STOP THEM FROM DOING THAT. Then change the sa password as follows:
您需要成为系统管理员才能创建系统管理员.因此,与其寻找解决问题的方法,这只会使您的安全状况比现在更糟,不如立即修复它并控制您的实例.
You need to be a sysadmin to create a sysadmin. So instead of finding a way around the issue, which only makes your security situation even worse than it already is, fix it now and take control of your instance.
这篇关于SQL Server - 使用“sysadmin"创建新的登录帐户来自没有“系统管理员"的帐户的角色角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!