The admin library is created automatically when the--auth parameter is added to the installation, but if there is no user in the library, the default is not required to verify that you can log on directly Use the following steps to create an administrator account: run Mongo.exe, perform show DBS can see admin and local two libraries
Switch to Admin library use Admin
Execute Add user name Db.adduser (' Kenny ', ' 123456 ')
The additional user in the Admin library is the Administrator account, and you can access all the libraries, but only if you need to validate them in the Admin library on each visit, you can go directly to the other libraries, as follows: switch to admin library
Use admin
View Collections
Show collections
The hint message contains: Unauthorized description not validated, verify Db.auth (' Kenny ', ' 123456 ') using the following methods
A return of 0 means that the validation failed, and 1 indicates that the validation succeeded Then execute show collections to see System.index and System.users.
This has been validated in the Admin library, and then switching to any library using the use command can be done directly
Note: Each library must have an account, otherwise no account of the library by default or can not be authenticated access, even if the installation of the--auth parameters added
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.