db.createUser(仍然没有验证,重新安装mongod --reinstall --dbpath "E:\mongodb\db" --logpath "E:\mongodb\log\MongoDB.log" --auth net start mongodb 然后就可以通过密码访问了 修改用户:db.updateUser("root",{roles :[{role:"root",db:"admin"},{role:"dbOwner",db:"example"}],pwd:"****"
{
user: "admin",
pwd: "admin",
roles: [ "userAdminAnyDatabase", "dbOwner" ]
}
)
})