MongoDB "Increase user authentication, increase users, delete users, modify user passwords, read and write permissions, read-only Permissions"

Source: Internet
Author: User

Description: Increase the user to operate against the database1. Go to database use dbname2. Adding user rights for the current database is for the current data1. Add and verify the user>Use admin> Db.adduser ("Zjx", "Tsjianxin")> Db.auth ("Zjx", "Tsjianxin")2. To view existing users>Db.system.users.find ()3. Now, to configure a read-write permission for another database 51CV-www.2cto.com-User>Use 51CV> Db.adduser ("51CVRW", "51CV")  ..."ReadOnly":false...4. Configure a user with read-only permissions>Use 51CV> Db.adduser ("51cvr", "51CV",true)>db.system.users.find () ..."ReadOnly":true...5. Deleting users>Use dbname (admin or 51CV, etc)> Db.system.users.remove ({User: "haha"})>Db.system.users.find ()6. User logon Database Test for: Mongod dbname-u uname-P Passwordmongo Admin-U zjx-p tsjianxin

MongoDB "Increase user authentication, increase users, delete users, modify user passwords, read and write permissions, read-only Permissions"

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.