MongoDB not authorized for query admin.system.users

前端 未结 4 726
滥情空心
滥情空心 2021-01-06 16:01

I am bit new to MongoDb and I am using MongoDb v.2.4.Here the problem is that when I run the mongod with --auth parameter, even after authenticating I am not able to perform

4条回答
  •  猫巷女王i
    2021-01-06 16:43

    > use admin
    switched to db admin
    > db.grantRolesToUser("your_admin_name" ,[ "root"])
    

    This command will give you all privileges on any db as admin.

提交回复
热议问题