MongoDB 3.0. More than 3 GUI connection authentication issues

Source: Internet
Author: User

Because the project to use MongoDB, today tried to build a bit.

First MONGO is still very good, yum or manual download, I am the most recent version of Yum installed 3.0.4.

Basically, after the installation is complete, a GUI management tool needs to be installed, and I have tried a lot, all the same. Finally, choose to use Robomongo because this GUI tool has versions on Linux, MAC, and Windows.

I install it on CentOS and then modify the/etc/mongod.conf file after it's installed.

1 27017 2 3 true 4 5 0.0. 0.0

Modify these three lines.

After the problem is on the connection authentication, MongoDB 3.0 later version authentication becomes complex, the connection tool can not connect, must modify the authentication version

>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})

Create the user after the modification is complete. The shell that creates the database user is attached below:

1 Create a root user:

Use Admindb.createuser (    {      "superuser",      pwd " 12345678 " ,       " Root "  ]    })

2 Create Admin user

Use Admindb.createuser (  {    "siteuseradmin",    pwd  "password",    "useradminanydatabase " " Admin "  } ]  })

3 Creating a database-specific user

Use Recordsdb.createuser (  {    "recordsuseradmin",      PWD"password",    "useradmin"  "Records"  }]  })

Finally, we have to certify.

Db.auth ("user""pwd")

Returns 1 for success, 0 for failure.

MongoDB 3.0. More than 3 GUI connection authentication issues

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.