使用Robomongo 连接MongoDB 3.x 报 Authorization failed 解决办法(转)
2016-07-07 17:42
603 查看
最近安装了mongodb3.1.4,并启用了权限验证,在dos窗口下操作没有任何问题,为了维护方便就下载了一个客户端工具Robomongo 0.8.5,用户名、密码的等配置好点解测试,结果连接服务没有问题,权限验证没有通过,如图
查看日志,发现有一句:Failed to authenticate admin@admin with mechanism MONGODB-CR: AuthenticationFailed MONGODB-CR credentials missing in the user document
试了各种办法,百度查遍无一个可以解决,没办法只能问谷歌了,最终在一个国外网站发现原来还是mongodb数据库的版本问题,查询版本
解决思路:在非权限验证状态下 首先,删除已有用户并;其次,修改version表的currentVersion,功能后在重新创建用户
操作步骤:
1、删除用户:db.dropUser("admin");
2、修改version:db.system.version.update({ "_id" : "authSchema"},{$set: {"currentVersion" : 3} }) ;
3、重新创建用户:
db.createUser({user:"admin",pwd:"admin",roles:[{"role":"userAdminAnyDatabase","db":"admin"},{"role":"readWrite","db":"test"}]})
4、重启mongdb服务,再次测试,
搞定收工了。
查看日志,发现有一句:Failed to authenticate admin@admin with mechanism MONGODB-CR: AuthenticationFailed MONGODB-CR credentials missing in the user document
试了各种办法,百度查遍无一个可以解决,没办法只能问谷歌了,最终在一个国外网站发现原来还是mongodb数据库的版本问题,查询版本
解决思路:在非权限验证状态下 首先,删除已有用户并;其次,修改version表的currentVersion,功能后在重新创建用户
操作步骤:
1、删除用户:db.dropUser("admin");
2、修改version:db.system.version.update({ "_id" : "authSchema"},{$set: {"currentVersion" : 3} }) ;
3、重新创建用户:
db.createUser({user:"admin",pwd:"admin",roles:[{"role":"userAdminAnyDatabase","db":"admin"},{"role":"readWrite","db":"test"}]})
4、重启mongdb服务,再次测试,
搞定收工了。
相关文章推荐
- Failed to load class "org.slf4j.impl.StaticLoggerBinder"异常解决办法
- INS-06002: Authentication failed
- aidl长连接小记
- Codeforces Round #360 (Div. 1) B. Remainders Game(中国剩余定理)
- [Saltstack]-{grains,pillar}[二]
- leetcode336. Palindrome Pairs
- Chainer's simple implementation of fast R-CNN
- http://blog.csdn.net/sd0902/article/details/8395677
- wait、sleep、notify、notifyAll的区别
- ORA-04098: trigger 'SYS.OLAPISHUTDOWNTRIGGER' is invalid and failed re-validation
- VC内存溢出一例 –- 调用约定不一致 (_CRT_DEBUGGER_HOOK(_CRT_DEBUGGER_GSFAILURE)
- adcmctl.sh wait=Y
- sun solairs安装11gr2RAC,界面打不开
- 约束Constraints
- 【USACO TRAINING】数字金字塔
- Confidentiality, Integrity, Availability: The three components of the CIA Triad
- 嵌入式系统开发—RainXXX系统理解1
- Find K Pairs with Smallest Sums
- 出现Assertion failure in -[***** layoutSublayersOfLayer:]
- servermain启动过程