MongoDB non-admin library Authentication login Failure Reason (Baidu is a lot of slag) Db.adduser () please go away.

Source: Internet
Author: User

First, let's get a tan. Log logs error message

2016-07-13t22:19:43.667+0800 I ACCESS [CONN4] Authenticate Db:finddemo {authenticate:1, nonce: "xxx", User: "User1", Key: "xxx"}2016-07-13t22:19:43.668+0800 I ACCESS [CONN4] Failed to authenticate [Email protected]ddemo with Mecha Nism mongodb-cr:authenticationfailed:usernotfound:could not find User [email protected]2016-07-13t22:20:12.555 +0800 I ACCESS [CONN2] scram-sha-1 authentication failed for User1 on Finddemo from client 127.0.0.1; Usernotfound:could not find User [email protected]2016-07-13t22:20:17.127+0800 I NETWORK [Initandlisten] Connection accepted from 127.0.0.1:56103 #5 (4 connections now OPEN) 2016-07-13t22:20:17.127+0800 I ACCESS [Conn5] Authe Nticate db:admin {authenticate:1, nonce: "xxx", User: "Root", Key: "xxx"}2016-07-13t22:20:17.146+0800 I NETWORK [init Andlisten] Connection accepted from 127.0.0.1:56104 #6 (5 connections now OPEN) 2016-07-13t22:20:17.146+0800 I ACCESS [Co NN6] Authenticate db:admin {authenticate:1, nonce:"XXX", User: "Root", Key: "XXX"} 

Focus on this error message,

Scram-sha-1 authentication failed for User1 on Finddemo

What kind of bird is this?

MongoDB joins the Scram-sha-1 verification method, requires a third-party tool to be validated, the following specific solutions:

First turn off authentication, modify the System.version document inside the Authschema version is 3, the initial installation should be 5, the command line as follows:

>Use Admin switched to DB admin>varSchema = Db.system.version.findOne ({"_id":"Authschema"}) > schema.currentversion =3 3>Db.system.version.save (Schema) Writeresult ({"nmatched":1,"nupserted":0,"nmodified":1})

The following is information about the user that was obtained

{"_id":"Admin.root","User":"Root","DB":"Admin","Credentials": {"MONGODB-CR":"97a156792bd180dc82cec9a56d838991"},"Roles": [ {"role":"__system","DB":"Admin" } ] }{ "_id":"Finddemo.finddemo","User":"Finddemo","DB":"Finddemo","Credentials": {"MONGODB-CR":"4b8dce39de95d553473c1998f43aa165"},"Roles": [ {"role":"Dbowner","DB":"Finddemo"} ] }

Reconnect, success.

You can check the link description:

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

And the answer of foreign friends: (More and more despise Baidu Party)

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

  

MongoDB non-admin library Authentication login Failure Reason (Baidu is a lot of slag) Db.adduser () please go away.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.