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. Windows环境下多线程编程原理与应用读书笔记(1)————基本概念

    自从学了操作系统知识后,我就对多线程比较感兴趣,总想让自己写一些有关多线程的程序代码,但一直以来,发现自己都没怎么好好的去全面学习这方面的知识,仅仅是完成了操作系统课程上的小程序,对多线程的理解也不是 ...

  2. webservice wsdl语法基础

    XML-WSDL基础知识 WSDL 1.1. WSDL 简介 1.1.1.    概述 WSDL 指网络服务描述语言 (Web Services Description Language) WSDL ...

  3. Crazy Calendar (阶梯博弈变形)

    2011 was a crazy year. Many people all over the world proposed on 11-11-11, married on 11-11-11, som ...

  4. John

    John Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submissi ...

  5. 0_Simple__asyncAPI

    关于CPU - GPU交互的简单接口函数. ▶ 源代码: // includes, system #include <stdio.h> // includes CUDA Runtime # ...

  6. escape、unescape、encodeURIComponent、decodeURLComponent

    项目中遇到的问题,当我设置一个标签的属性,这个属性值含有js内容,这样就会被执行产生安全问题 解决办法:,可以将后端给的内容先encodeURIComponent,获取的时候再decodeURICom ...

  7. Object.observe() 观察对象

    这个对象方法可以用来异步观察对javascript对象的改动: // Let's say we have a model with data var model = {};   // Which we ...

  8. 解决autocad闪退

    1.进入注册表,regedit 2.找到ROOT\installer\Products ,找到以7D2F开头的键值,这里有两个都得删除 3.删除programdata目录下的AutoDesk目录,及f ...

  9. (11.13)Java小知识!

    今天想要与大家分享一下有关于构造方法的知识! 构造方法的定义与作用 构造方法是一种特殊类型的方法.当一个对象被创建的时候,构造方法用来初始化对象,也就是说构造方法其实是一个名词而不是动词,像我刚刚开始 ...

  10. postgis几何操作函数集

    管理操作函数 AddGeometryColumn - Adds a geometry column to an existing table of attributes. By default use ...