zoukankan      html  css  js  c++  java
  • mongodb 错误 SCRAM-SHA-1 authentication failed for --转

    log 日志错误信息

    2018-10-24T16:14:42.244+0800 I NETWORK [initandlisten] connection accepted from 192.168.1.198:37354 #165 (2 connections now open)
    2018-10-24T16:14:42.250+0800 I ACCESS [conn165] SCRAM-SHA-1 authentication failed for djx123 on djx_test from client 172.16.2.208 ; UserNotFound Could not find user djx123@djx_test
    2018-10-24T16:14:42.253+0800 I NETWORK [conn165] end connection 192.168.1.198:37354 (1 connection now open)
    2018-10-24T16:14:42.756+0800 I NETWORK [initandlisten] connection accepted from 192.168.1.198:37356 #166 (2 connections now open)
    2018-10-24T16:14:42.762+0800 I ACCESS [conn166] SCRAM-SHA-1 authentication failed for djx123 on djx_test from client 172.16.2.208 ; UserNotFound Could not find user djx123@djx_test
    2018-10-24T16:14:42.765+0800 I NETWORK [conn166] end connection 192.168.1.198:37356 (1 connection now open)
    2018-10-24T16:14:43.268+0800 I NETWORK [initandlisten] connection accepted from 192.168.1.198:37358 #167 (2 connections now open)
    2018-10-24T16:14:43.274+0800 I ACCESS [conn167] SCRAM-SHA-1 authentication failed for djx123 on djx_test from client 172.16.2.208 ; UserNotFound Could not find user djx123@djx_test

    mongodb 加入了SCRAM-SHA-1校验方式,需要第三方工具配合进行验证,下面给出具体解决办法: 

    首先关闭认证(noauth = yes),修改system.version文档里面的authSchema版本为3,初始安装时候应该是5,命令行如下: 

    复制代码
    > use admin 
    switched to db admin 
    >  var schema = db.system.version.findOne({"_id" : "authSchema"}) 
    > schema.currentVersion = 3 
    3 
    > db.system.version.save(schema) 
    WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })  
    复制代码

     更改后用之前的用户进行登录的话还是登录不了,因为之前之前的用户是基于之前的认证生成的,

    我们将之前的用户删除,删除后重新创建用户

    重新连接,成功。

    可以查看一下链接介绍:

    https://docs.mongodb.com/master/release-notes/3.0-scram/

    还有国外友人的回答:

    http://stackoverflow.com/questions/29006887/mongodb-cr-authentication-failed

    本文转自https://www.cnblogs.com/timelesszhuang/p/5668589.html

  • 相关阅读:
    Vue- 对象语法 v-bind:class与对象语法的使用(重要)
    关于vue中$emit事件问题
    深入理解vue.js2.0指令v-for使用及索引获取
    到底vuex是什么?
    Vue.js学习系列二 —— vuex学习实践笔记(附DEMO)
    前端HTML5几种存储方式的总结
    JSON和JS对象之间的互转
    Vue2.0子父组件通信
    C#字符串和16进制转换
    C#中int32 的有效值范围
  • 原文地址:https://www.cnblogs.com/operationhome/p/9844268.html
Copyright © 2011-2022 走看看