当前位置: 移动技术网 > IT编程>数据库>MSSQL > SQL Server 2005的cmd_shell组件的开启方法

SQL Server 2005的cmd_shell组件的开启方法

2017年12月08日  | 移动技术网IT编程  | 我要评论

外国男体,八戒自吹法术精,友道木业

sql server中的cmd_shell组件功能强大,几乎可通过该组建实现windows系统的所有功能,正因此,这个组件也是sql server的最大安全隐患。sql server 2000中这个组件是默认开启的,而sql server 2005中这个组件默认作为此服务器安全配置的一部分而被关闭。有时我们需要用到该组件,开启此组件的相关语句如下:

复制代码 代码如下:

--to allow advanced options to be changed.

exec sp_configure 'show advanced options', 1
go

--to update the currently configured value for advanced options.
reconfigure
go -- to enable the feature.

exec sp_configure 'xp_cmdshell', 1
go
--to update the currently configured value for this feature.
reconfigure
go


为了保证数据库服务器的安全,建议在使用完毕后关闭该组件,关闭该组件的相关语句如下:

复制代码 代码如下:

--to allow advanced options to be changed.

exec sp_configure 'show advanced options', 1
go

--to update the currently configured value for advanced options.
reconfigure
go -- to enable the feature.

exec sp_configure 'xp_cmdshell', 0
go
--to update the currently configured value for this feature.
reconfigure
go

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网