Can't create backup mongodump with --db. Authentication failed

后端 未结 14 1011
深忆病人
深忆病人 2020-12-29 18:22

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

14条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-29 18:39

    If you still get same error with --authenticationDatabase admin , than probably your username and password are incorrect. Try adding a user db.createUser() , with appropriate role ( i gave write permission as well)

    than run below command : (ignore -h if you are running on local)

     mongodump -h : -d db_name -u newUser -p newPassword -o /home/mongodump/
    

    Hope this helps...

提交回复
热议问题