When you use mongoDB started as "mongod --dbpath ../../data/db --auth", and you use the existed use in your database, but you will get error like this "purchase_user@purchase failed. MongoDB-CR Authentication failed. Missing credentials in user document when I access webservice through browser."

How to deal with this problem?

Go to mongoDB shell and delete your current user & set authSchema version 3 to instead of 5, follow these commands in mongo shell:

mongo
use admin
db.system.users.remove({}) <== removing all users
db.system.version.remove({}) <== removing current version
db.system.version.insert({ "_id" : "authSchema", "currentVersion" : })

Now restrat the mongod and create new user then it should work fine.

Note: Use remove commands in test db only, if in production use update.

MongoDB-Use --auth parameter with connecting error的更多相关文章

  1. 【转载】MySQL 5.6主从Slave_IO_Running:Connecting/error connecting to master *- retry

    原文地址:MySQL 5.6主从Slave_IO_Running:Connecting/error connecting to master *- retry 作者:忆雨林枫 刚配置的MySQL主从, ...

  2. mongodb Enable Auth

    启动mongodb没有使用通道控制 mongod --port 27017 --dbpath /data/db1 连接mongo mongo --port 27017 创建用户 use admin d ...

  3. MySQL 5.6主从Slave_IO_Running:Connecting/error connecting to master *- retry

    刚配置的MySQL主从,在从机上看到 点击(此处)折叠或打开 mysql> SHOW slave STATUS \\G *************************** 1. row ** ...

  4. mongodb启用auth,使用密码登录

    更新操作: db.users.update({'currentVersion':3},{$set:{'currentVersion':5}}) 首先安装下载(略过) mongod 启动服务,有多重启动 ...

  5. MongoDB加auth权限

    目录 裸奔有多危险 mongoDB修改默认端口号 关闭MongoDB 重启MongoDB 设置密码 吹个牛B,自己的MongoDB裸奔了快半年,从未遭受黑客攻击.也不知道是自己运气好,还是黑客对我的乞 ...

  6. Filebeat issue 排查--single.go:140: ERR Connecting error publishing events (retrying): dial tcp ****:5044: i/o timeout

    我个人用docker搭建了一套日志分析平台:ELK+Filebeat 在正常跑了半个多月之后,Kibana刷新日志时突然发现日志不在更新了,停在某个时刻,就再也没有新log. 首先我查看了elk,lo ...

  7. [mongodb]child process failed, exited with error number 100

    Run the following command first to start the mongo server mongod run --config /usr/local/etc/mongod. ...

  8. MongoDB的Replica Set以及Auth的配置

    http://blog.0x01.site/2017/01/13/MongoDB%E7%9A%84Replica-Set%E4%BB%A5%E5%8F%8AAuth%E7%9A%84%E9%85%8D ...

  9. MongoDB AUTH结果验证及开启方法

          创建超级管理员(root)和普通用户(gxpt) #创建超级管理员(root) RS1:PRIMARY> use admin RS1:PRIMARY> db.createUse ...

随机推荐

  1. input file选择图片后 预览

    很多前端都选择用插件来实现图片预览,这个小功能也可以很简单的用jQuery来实现 简单的jQuery实现input file选择图片后,可以预览图片的效果 简单的HTML代码: <div> ...

  2. 谈谈今年很火的区块链 CDN

    2017 年初,区块链被越来越多的人知道.区块链的概念其实很早就被提出来,曾经有人说过"区块链技术被认为是继蒸汽机.电力.互联网之后,下一代颠覆性的核心技术. 如果说蒸汽机释放了人们的生产力 ...

  3. FatMouse and Cheese

    FatMouse and Cheese Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u ...

  4. zepto在操作dom的selected和checked属性时尽量使用prop方法

    zepto在操作dom的selected和checked属性时尽量使用prop方法.

  5. Jquery基础笔记

    1.$(function(){               等价于     window.onload=function(){ })                               } 2 ...

  6. 学习C++ 模板类

    #include<iostream>#include<typeinfo>#include<cstring> using namespace std; class A ...

  7. DbContext 中的 Explicit interface implementation

    疑惑 前段时间一直再用Entity Framework 6,写了一些公用的方法,在这个过程中发现了DbContext实现的接口IObjectContextAdapter,可以通过这个接口访问到更底层的 ...

  8. 发放福利:原价135元/年的阿里云CDN流量包(500GB)免费送

    不少朋友看过本站推荐的两篇文章:1. <阿里云全民云计算活动:云服务器ECS二折起>2. <阿里云双11优惠活动-爆款云服务器> 大部分人都说不错,很快下单购买了服务器,后续使 ...

  9. 用CRT查找内存泄漏

    引用原文地址 : https://msdn.microsoft.com/en-us/library/x98tx3cf.aspx 1. 在program中严格按下面顺序include #define _ ...

  10. 【玩转树莓派】使用 sinopia 搭建私有 npm 服务器

    简介 使用 sinopia 的好处是,node系的工程师,内部协作时,使用自有 npm 包,会非常方便:另外,sinopia,会缓存已经下载过的包,可以在相当程度上,加速 npm install 相关 ...