如何修复无法添加密码的情况?
db.createUser({user:'root',pwd:'hello!0.', roles:[{role:'userAdminAnyDatabase', db:'admin'}]})
Successfully added user: {
"user" : "root",
"roles" : [
{
"role" : "userAdminAnyDatabase",
"db" : "admin"
}
]
}`
答案 0 :(得分:0)
Mongodb默认没有权限访问权限,因此您需要打开访问权限auth = ture