[MongoDB] not authorized on test to execute command-MongoDB的权限配置
2016-06-14 16:22
651 查看
not authorized on test to execute command-MongoDB的权限配置 直接报Command '$eval' failed: not authorized on这个错误,可以确认是权限的问题 解决方案: 在官网 http://docs.mongodb.org/manual/reference/command/eval/#dbcmd.eval 有一段描述: If authorization is enabled, you must have access to all actions on all resources in order to run eval. Providing such access is not recommended, but if your organization requires a user to run eval, create a role that grants anyAction on anyResource. Do not assign this role to any other user. 解决步骤: 1)不带--auth参数启动数据库,所以不需要帐号即可连上MongoDB。 2)新建一个角色,比如叫 sysadmin,需要先切换到admin库进行如下操作: [C#] 纯文本查看 复制代码 ? [C#] 纯文本查看 复制代码 ? --auth 就可以正常执行了 |
相关文章推荐
- win7 安装 mongodb
- mongoDB查询之find
- MongoDB 3.0 安全权限访问控制
- MongoDB安装环境搭建
- Linux系统下MongoDB的简单安装与基本操作
- LINUX 安装 MongoDB
- mongodb插入数据报错:malformed UTF-8 character sequence at offset
- (转)部署MongoDB时需要注意的调参
- mongodb的find()函数如何只显示文档中指定的域(列)?
- MongoDB【第二篇】MongoDB逻辑与物理存储结构
- mongodb查询文档
- MEAN全栈开发学习笔记1===>栈的安装
- MongoDB学习
- MongoDB(四)分片集群
- MongoDB(三)主从复制以及副本集的配置和使用
- MongoDB(二)主从复制以及副本集的配置和使用
- MongoDB(一)简介和安装使用
- 【MongoDB】递归获取字段更新表达式,更新复杂数据类型对象
- mongodb的find().pretty()方法的作用。
- net start mongodb 提示:发生系统错误 5,拒绝访问。