mongodb 错误 SCRAM-SHA-1 authentication failed for --转 - Go语言中文社区

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

转载于:https://www.cnblogs.com/operationhome/p/9844268.html

版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/weixin_30312557/article/details/97707053
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2021-04-12 07:36:20
  • 阅读 ( 1789 )
  • 分类:数据库

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢