SQL Server blocked access to procedure 'sys.xp_cmdshell'

SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. For more information about enabling 'xp_cmdshell', see "Surface Area Configuration" in SQL Server Books Online.

---------------------------------------------------------------------------------------------------------------------

【解决办法】:
  1、通过SQL语句开启。[推荐此方法,因为在任何版本的SQL SERVER中都可以使用。]
  通过查询分析器,选择Master数据库,然后执行以下SQL内容:

sp_configure 'show advanced options',1
reconfigure
go
sp_configure 'xp_cmdshell',1
reconfigure
go

  执行结果:

  配置选项 'show advanced options' 已从 0 更改为 1。请运行 RECONFIGURE 语句进行安装。
  配置选项 'xp_cmdshell' 已从 0 更改为 1。请运行 RECONFIGURE 语句进行安装。

  如需关闭只需将“sp_configure 'xp_cmdshell',1”改为“sp_configure 'xp_cmdshell',0”即可。

 

  2、通过"SQL SERVER外围应用配置器"开启。[如果记代码困难,那就用此方法吧。]

  找到开始 --> SQL安装目录 --> 配置 SQL server managerment 外围应用配置器。如图:

SQL <wbr>Server <wbr>blocked <wbr>access <wbr>to <wbr>procedure <wbr>'sys.xp_cmdshell'

  打开后。找到并点击“功能的外围应用配置器”。

SQL <wbr>Server <wbr>blocked <wbr>access <wbr>to <wbr>procedure <wbr>'sys.xp_cmdshell'

  再打开的窗口中点击最下面的 xp_cmdshell然后点击右边的启用即可。

SQL <wbr>Server <wbr>blocked <wbr>access <wbr>to <wbr>procedure <wbr>'sys.xp_cmdshell'

 

  打开后,找到“xp_cmdshell”点击启用。



转载于:https://www.cnblogs.com/liuzhuqing/p/7480117.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值