mongodb 操作记录

1.show dbs
2.use admin
3.db.auth('root','example')
4.show dbs
5.use testdb

  1. usedb.createUser({user:'test',pwd:'123456',roles:[{role:'dbOwner',db:'testdb'}]})
    7.use testdb
    8.db.auth('test','123456')

你可能感兴趣的:(mongodb 操作记录)