Skip to content

Instantly share code, notes, and snippets.

@aNd1coder
Last active October 18, 2016 02:30
Show Gist options
  • Save aNd1coder/76d5ce8932e11901021b1a793285aa77 to your computer and use it in GitHub Desktop.
Save aNd1coder/76d5ce8932e11901021b1a793285aa77 to your computer and use it in GitHub Desktop.
Mongodb create database and user
> 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')
@lichenbuliren
Copy link

收藏下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment