标签:auth dmi min -- admin nan use god creat
use sanhe
db.auth(‘sanhe‘,‘35DJqemUv72‘);
use admin
show dbs;
db.auth("root","1qaz@WSX")
use admin
db.createUser({user: "root",pwd: "1qaz@WSX",roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]})
./mongo --auth
db.auth("myUserAdmin", "abc123")
> db.grantRolesToUser("myUserAdmin", [ { role: "read", db: "admin" } ])
标签:auth dmi min -- admin nan use god creat
原文地址:https://www.cnblogs.com/zplogo/p/12234910.html