"MongoDB" MongoDB 3.2 scram-sha-1 authentication method

Source: Internet
Author: User

The new version has canceled the AddUser method, use the CreateUser method

Official address: https://docs.mongodb.com/manual/tutorial/create-users/

Official address: https://docs.mongodb.com/manual/reference/command/createUser/#dbcmd. CreateUser

Role permissions: https://docs.mongodb.com/manual/reference/built-in-roles/#built-in-roles

Db.createuser ({   User:' user ',  pwd:' passwd ',  roles:["Dbadminanydatabase", "Readwriteanydatabase"]})

The new version uses the Scram-sha-1 authentication method by default, and this error is encountered when connecting to MONGO:

Error: Failed to authenticate *@* with mechanism MONGODB-CR:AUTHENTICATIONFAILED:MONGODB-CR credentials missing in the user Document

> Use Admin   
Switched to DB admin
var schema = Db.system.version.findOne ({"_id": "Authschema"}) >schema.currentversion = 3 3> Db.system.version.save (Schema)

Users who cannot log on need to remove the re-add

"MongoDB" MongoDB 3.2 scram-sha-1 authentication method

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.