mongod用户无法创建密码?

时间:2017-12-26 05:27:49

标签: mongodb

如何修复无法添加密码的情况?

db.createUser({user:'root',pwd:'hello!0.', roles:[{role:'userAdminAnyDatabase', db:'admin'}]})  

Successfully added user: {
    "user" : "root",
    "roles" : [
            {
              "role" : "userAdminAnyDatabase",
              "db" : "admin"
            }
    ]
    }`

1 个答案:

答案 0 :(得分:0)

Mongodb默认没有权限访问权限,因此您需要打开访问权限auth = ture