SQLServer xp_instance_regread returned error 5,Access is denied(配置最小权限)
公司一套智能巡检系统,客户需要最小的权限去给这套系统使用;配置完后发现很多权限报错,有一条是关于xp_instance_regread读系统注册表error 5的报错。常理error 5.是属于系统权限问题,遂开始首先对需求注册表路径添加了everyone 的只读权限。如果能成功就不会写这个笔记了。
系统:windows2008R2
数据库: SQLServer2008R2
首先创建SQL账号:
其次赋予对xp_instance_regread权限
use master
go
grant exec on xp_instance_regread to monitor;
execute as user='monitor'
go
exec xp_instance_regread 'HKEY_LOCAL_MACHINE','HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0','ProcessorNameString';
报错如下图:

原因就是sql账号没权限读注册表。
下面是添加注册表:
打开服务器 运行 输入 regedit :依次找到HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\
然后展开分支:找到依MSSQL开头SQLSERVER结尾的那层目录,找到MSSQLServer目录展开
然后新建一个键值命名为:ExtendedProcedures
点击ExtendedProcedures,在右侧空白处新建Multi-String类型的命名为xp_regread allowed paths;
然后打开xp_regread allowed paths这个文件,添加你要用数据库账号读的注册表路径;
如下图:

添加你要读的注册表路径:

最后测试:

这只是一种方法,这中问题遇到的概率很少,添加sysadmin权限也可以,把sql账号换成域账号也可以,估计服务器账号不识别没有服务器权限的sql账号。
SQLServer xp_instance_regread returned error 5,Access is denied(配置最小权限)的更多相关文章
- Distribution setup SQL Server Agent error: "RegCreateKeyEx() returned error 5, 'Access is denied.'" (转载)
In the Configure Distribution Wizard, the step "Configuring SQL Server Agent to start automatic ...
- CREATE FILE encountered operating system error 5(Access is denied.)
这篇博文主要演示"CREATE FILE encountered operating system error 5(Access is denied.)"错误如出现的原因(当然只是 ...
- [解决]Mercurial HTTP Error 500: Access is denied on 00changelog.i
总之,用户对仓库目录要有写权限 00changelog, access is denied, hg, http error 500, mercurial, permissions, push Merc ...
- Parser Error Message: Access is denied【转】
PRB: Access Denied Error When You Make Code Modifications with Index Services Running View products ...
- remote: Permission to user_name/Code.git denied to other_user_name. fatal: unable to access 'https://github.com/user_name/Code.git/': The requested URL returned error: 403
Error msg: $ git push remote: Permission to xxx/Code.git denied to xxxxxx. fatal: unable to access ' ...
- 一看便知linux下mysql报错ERROR 1044: Access denied for user: '@localhost' to database 'mysql'
错误信息:ERROR 1044: Access denied for user: '@localhost' to database 'mysql' linux下解决方案: mysql> use ...
- 解决mysqldump: Got error: 1044: Access denied for user
转自:http://blog.slogra.com/post-512.html 今天给新加的几个数据库备份,在执行mysqldump的时候,居然报mysqldump: Got error: 1044: ...
- server error in '/' applecation----Compiler Error Message: CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\xx' -- 'Access is denied
今天在阿里云虚拟机上部署新站点后出现下面的错误:server error in '/' applecation Compiler Error Message: CS0016: Could not wr ...
- QTP Test ,VAPI-XP Test,LR Test 和ALM 集成远程分布式执行遇到的“access is denied ” “unspecified error”问题
大家都知道QTP与ALM (QC的升级版)集成是最好的一个分布式执行的结合.因为毕竟QTP是一个商业软件,HP当然不会让你去跟其他的open source的工具去集成,要不他到哪里去挣钱. 有时候服务 ...
随机推荐
- DeepID1,DeepID2
1.DeepID1 (Deep Learning Face Representation from Predicting 10,000 Classes) Step1:构建网络框架 DeepConvNe ...
- Git 笔记——如何处理分支合并冲突
1.前言 学习使用 Git 也有一段时间,但一直都是把 Git 当作一个代码仓库,使用的命令无非就是 clone, add, commit ,往往课程作业也没有过多人合作开发,没有体验过 Git 的分 ...
- Window环境下RabbitMQ的安装和配置教程
一.安装 首先,RabbitMQ基于Erlang语言环境,所以需要先安装Erlang. Erlang下载地址:http://www.erlang.org/downloads 按照安装程序默认安装完成就 ...
- 各组Beta版本发布点评
1. 新蜂:俄罗斯方块 俄罗斯方块已经基本完成了所有功能,运行流畅,也加入了之前用户期待的即将降落的方块和游戏积分的功能,用户还能随时暂停和继续游戏. 2. 天天向上: 连连看游戏 连连看游戏在核心 ...
- 技术分享会:深度学习Deep Leanring
作为宴会的散席,技术老大给大家分享了:Deep Leanring Machine Learning是Deep Learning的一个超集. Deep Leanring,依赖于神经网络,当前的技术优势是 ...
- SqlServer测试SQL语句执行效率
方法一: SET STATISTICS io ON SET STATISTICS time ON go ---需要测试的sql语句 go SET STATISTICS profile OFF SET ...
- SpringBoot 7.SpringBoot 结合 Thymeleaf
一.引入 Thymeleaf 依赖 <!-- Spring boot - thymeleaf --> <dependency> <groupId>org.sprin ...
- Android studio Gradle编译错误: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 400 Bad Reques
两种处理方法: 1.修改distributionUrl链接 gradle-wrapper.properties文件 distributionUrl=https\://services.gradle.o ...
- 【IneliJ 】使用IneliJ IDEA 2016将Java Web项目导出为War包
本文记录使用IDEA导出war包的过程以及碰到问题的解决办法 虽说现在改用IDEA进行开发了,但还是用eclipse打war包 ….囧 这样下去不是办法... 于是今天就试着使用IDEA进行打包. 项 ...
- iOS 打开系统设置的常用功能
说明: 跳转到系统设置不同功能界面,只要知道路径都很简单,路径可以自己打开手机设置界面看, 照着模板把对应的名称替换就可以了,但是得知道对应功能的英文名称. 1. prefs:root=Privacy ...