mongodb-Permissions Configuration

Source: Internet
Author: User

Start Mongo\bin\mongo.exe
1. Add
>use admin# Switch to the MONGODB database user table
>db.adduser ("Name", "Password") #创建读写权限用户
>db.adduser ("Name", "Password", True) #创建只读权限用户
>show users# Show all users of the current library
Note: Users of a single library simply need to switch to the appropriate library

2. Delete [must operate in a non-privileged login case]
>use Admin
>db.system.users.remove ({"User": "Name"}) #删除用户

3. Login
>use Admin
>db.auth ("Name", "Password")
Note: Users of a single library simply need to switch to the appropriate library

mongodb-Permissions Configuration

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.