1.show dbs
2.use admin
3.db.auth('root','example')
4.show dbs
5.use testdb
- usedb.createUser({user:'test',pwd:'123456',roles:[{role:'dbOwner',db:'testdb'}]})
7.use testdb
8.db.auth('test','123456')
1.show dbs
2.use admin
3.db.auth('root','example')
4.show dbs
5.use testdb
本文标题:mongodb 操作记录
本文链接:https://www.haomeiwen.com/subject/xoufoctx.html
网友评论