MongoDB-Use --auth parameter with connecting error
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的更多相关文章
- 【转载】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主从, ...
- mongodb Enable Auth
启动mongodb没有使用通道控制 mongod --port 27017 --dbpath /data/db1 连接mongo mongo --port 27017 创建用户 use admin d ...
- MySQL 5.6主从Slave_IO_Running:Connecting/error connecting to master *- retry
刚配置的MySQL主从,在从机上看到 点击(此处)折叠或打开 mysql> SHOW slave STATUS \\G *************************** 1. row ** ...
- mongodb启用auth,使用密码登录
更新操作: db.users.update({'currentVersion':3},{$set:{'currentVersion':5}}) 首先安装下载(略过) mongod 启动服务,有多重启动 ...
- MongoDB加auth权限
目录 裸奔有多危险 mongoDB修改默认端口号 关闭MongoDB 重启MongoDB 设置密码 吹个牛B,自己的MongoDB裸奔了快半年,从未遭受黑客攻击.也不知道是自己运气好,还是黑客对我的乞 ...
- Filebeat issue 排查--single.go:140: ERR Connecting error publishing events (retrying): dial tcp ****:5044: i/o timeout
我个人用docker搭建了一套日志分析平台:ELK+Filebeat 在正常跑了半个多月之后,Kibana刷新日志时突然发现日志不在更新了,停在某个时刻,就再也没有新log. 首先我查看了elk,lo ...
- [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. ...
- 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 ...
- MongoDB AUTH结果验证及开启方法
创建超级管理员(root)和普通用户(gxpt) #创建超级管理员(root) RS1:PRIMARY> use admin RS1:PRIMARY> db.createUse ...
随机推荐
- Java基础笔记5
方法(函数) 就是一块可以重复调用的代码块. 比如.100行代码. 在多处使用. 方法的格式 public static 返回类型 方法名称(参数列表){ } 返回类型:当方法被调用时,把返回内容 交 ...
- JS框架设计读书笔记之-异步
setTimeout/setInterval 1. 如果回调执行时间大于间隔时间,真正的间隔时间会大一些. 2. 存在一个最小的时间间隔,即使seTimeout(fn,0),在IE6-IE8中大概为1 ...
- How to use VisualSVN Server and TortoiseSVN to host your codes and control your codes' version
############################### PART ONE ############################### #1. Introduction of the ...
- Caffe Ubuntu16.04 GPU安装
- C# orderby子句
注意:对联接运算的结果进行排序. 请注意,排序在联接之后执行. 虽然可以在联接之前将 orderby 子句用于一个或多个源序列,不过通常不建议这样做. 某些 LINQ 提供程序可能不会在联接之后保留该 ...
- css相关 细节 优化 备忘
<p>标签不能再包含<p>,也不能包含<div>,<div>可以包含<p> a 和 img 标签是特殊的行内元素,a标签可以包含div等,几 ...
- MUI开发记录——我的考勤
已经好久没有更新技术博客了,因为最近一直在做跨平台web app应用的开发,由于是刚做这个,也没太多经验同大家分享,可我是一个闲不住的人,我还是决定于百忙之中抽空整理一篇,记录下开发历程......— ...
- WebGL学习(2) - 3D场景
原文地址:WebGL学习(2) - 3D场景 经过前面WebGL学习(1) - 三角形的学习,我们已经掌握了webGL的基础知识,也已经能够画出最基本的图形,比如点,线,三角形,矩形等.有了2D绘图的 ...
- ASP.NET Core 异常处理与日志记录
1. ASP.NET Core 异常处理与日志记录 1.1. 异常处理 1.1.1. 异常产生的原因及处理 1.1.2. ASP.NET Core中启动开发人员异常页面 1.2. 日志记录 1.2.1 ...
- 使用PHP文件锁写一个多个请求同时并发写入一个文件,要求不脏读、数据不丢失
使用PHP文件锁写一个多个请求同时并发写入一个文件,要求不脏读.数据不丢失. //并发文件操作 function filehandle($filename,$data){ $start = 0; $e ...