Last active
October 18, 2016 02:30
-
-
Save aNd1coder/76d5ce8932e11901021b1a793285aa77 to your computer and use it in GitHub Desktop.
Mongodb create database and user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> use admin | |
> db.createUser({user: 'root',pwd: '123456',roles: ['root']}) | |
> db.auth('root','123456') | |
> use page_factory | |
> db.createUser({user: 'user',pwd: '123456',roles: [{role: 'readWrite', db: 'dbName'}]}) | |
> db.auth('user','123456') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
收藏下