When I create backup of all databases in MongoDB (version 3):
mongodump --username bacUser --password 12345
It\'s OK. But when I try to cre
The following steps worked for me on MongoDB 3.2:
mongo
use admin db.auth("admin", "yourpassword")
If this returns 1, the password is correct.
Then add the role "backup" to your admin (or make sure this role is already added). db.grantRolesToUser("admin", [{ role: "backup", db: "admin" }])
Finally, the mongodump command. It did not work for me when I tried to pass the password as an argument. Instead do this:
mongodump --username admin --authenticationDatabase admin --db yourmongodatabase
Then add your password when it promts for it.
This works for me...