Microsoft SQL Server 的 高权限用户 sysadmin

在Microsoft SQL Server中,sysadmin是最高级别的权限角色,它赋予用户对整个数据库服务器进行完全控制的权限。sysadmin角色的成员可以执行任意操作,包括创建、修改和删除数据库、登录名和其他安全对象,以及配置服务器级设置和选项。

要给用户分配sysadmin权限,可以按照以下步骤操作:

  1. 以sysadmin权限的登录账户(例如sa)登录到SQL Server Management Studio (SSMS)中。
  2. 在"对象资源管理器"窗口中,展开"安全性"文件夹。
  3. 右键单击"登录名"文件夹,然后选择"新建登录名"。
  4. 在"一般"页面上,输入登录名并选择相应的身份验证方法(Windows身份验证或SQL Server身份验证)。
  5. 切换到"服务器角色"页面,并选择"sysadmin"角色。
  6. 点击"确定"来创建新的登录名并将其授予sysadmin权限。

请注意,在授予sysadmin权限之前,请确保仔细考虑安全性和风险管理方面的问题。只有可信任的用户应该被授予sysadmin权限,因为他们具有对整个数据库服务器的完全控制权。

1> sp_help sysusers;
2> go
Name                                                                                                                             Owner                                                                                                                            Type                            Created_datetime       
-------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ------------------------------- -----------------------
sysusers                                                                                                                         sys                                                                                                                              view                            2020-06-12 22:41:04.860
 
 
Column_name                                                                                                                      Type                                                                                                                             Computed                            Length      Prec  Scale Nullable                            TrimTrailingBlanks                  FixedLenNullInSource                Collation                                                                                                                       
-------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ----------------------------------- ----------- ----- ----- ----------------------------------- ----------------------------------- ----------------------------------- --------------------------------------------------------------------------------------------------------------------------------
uid                                                                                                                              smallint                                                                                                                         no                                            2 5     0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
status                                                                                                                           smallint                                                                                                                         no                                            2 5     0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
name                                                                                                                             sysname                                                                                                                          no                                          256             no                                  (n/a)                               (n/a)                               Chinese_PRC_CI_AS                                                                                                               
sid                                                                                                                              varbinary                                                                                                                        no                                           85             yes                                 no                                  yes                                 NULL                                                                                                                            
roles                                                                                                                            varbinary                                                                                                                        no                                         2048             yes                                 no                                  yes                                 NULL                                                                                                                            
createdate                                                                                                                       datetime                                                                                                                         no                                            8             no                                  (n/a)                               (n/a)                               NULL                                                                                                                            
updatedate                                                                                                                       datetime                                                                                                                         no                                            8             no                                  (n/a)                               (n/a)                               NULL                                                                                                                            
altuid                                                                                                                           smallint                                                                                                                         no                                            2 5     0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
password                                                                                                                         varbinary                                                                                                                        no                                          256             yes                                 no                                  yes                                 NULL                                                                                                                            
gid                                                                                                                              smallint                                                                                                                         no                                            2 5     0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
environ                                                                                                                          varchar                                                                                                                          no                                          255             yes                                 no                                  yes                                 Chinese_PRC_CI_AS                                                                                                               
hasdbaccess                                                                                                                      int                                                                                                                              no                                            4 10    0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
islogin                                                                                                                          int                                                                                                                              no                                            4 10    0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
isntname                                                                                                                         int                                                                                                                              no                                            4 10    0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
isntgroup                                                                                                                        int                                                                                                                              no                                            4 10    0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
isntuser                                                                                                                         int                                                                                                                              no                                            4 10    0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
issqluser                                                                                                                        int                                                                                                                              no                                            4 10    0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
isaliased                                                                                                                        int                                                                                                                              no                                            4 10    0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
issqlrole                                                                                                                        int                                                                                                                              no                                            4 10    0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
isapprole                                                                                                                        int                                                                                                                              no                                            4 10    0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
 
Identity                                                                                                                         Seed                                     Increment                                Not For Replication
-------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------- ---------------------------------------- -------------------
No identity column defined.                                                                                                                                          NULL                                     NULL                NULL
 
RowGuidCol                                                                                                                      
--------------------------------------------------------------------------------------------------------------------------------
No rowguidcol column defined.                                                                                                   
 
No constraints are defined on object 'sysusers', or you do not have permissions.
 
No foreign keys reference table 'sysusers', or you do not have permissions on referencing tables.
The object 'sysusers' does not have any indexes, or you do not have permissions.
1> 
1> sp_help sysprotects;
2> go
Name                                                                                                                             Owner                                                                                                                            Type                            Created_datetime       
-------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ------------------------------- -----------------------
sysprotects                                                                                                                      sys                                                                                                                              view                            2020-06-12 22:41:04.890
 
 
Column_name                                                                                                                      Type                                                                                                                             Computed                            Length      Prec  Scale Nullable                            TrimTrailingBlanks                  FixedLenNullInSource                Collation                                                                                                                       
-------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ----------------------------------- ----------- ----- ----- ----------------------------------- ----------------------------------- ----------------------------------- --------------------------------------------------------------------------------------------------------------------------------
id                                                                                                                               int                                                                                                                              no                                            4 10    0     no                                  (n/a)                               (n/a)                               NULL                                                                                                                            
uid                                                                                                                              smallint                                                                                                                         no                                            2 5     0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
action                                                                                                                           tinyint                                                                                                                          no                                            1 3     0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
protecttype                                                                                                                      tinyint                                                                                                                          no                                            1 3     0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
columns                                                                                                                          varbinary                                                                                                                        no                                         8000             yes                                 no                                  yes                                 NULL                                                                                                                            
grantor                                                                                                                          smallint                                                                                                                         no                                            2 5     0     yes                                 (n/a)                               (n/a)                               NULL                                                                                                                            
 
Identity                                                                                                                         Seed                                     Increment                                Not For Replication
-------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------- ---------------------------------------- -------------------
No identity column defined.                                                                                                                                          NULL                                     NULL                NULL
 
RowGuidCol                                                                                                                      
--------------------------------------------------------------------------------------------------------------------------------
No rowguidcol column defined.                                                                                                   
 
No constraints are defined on object 'sysprotects', or you do not have permissions.
 
No foreign keys reference table 'sysprotects', or you do not have permissions on referencing tables.
The object 'sysprotects' does not have any indexes, or you do not have permissions.
  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值