Tried taking dump from a remote node and got the following error:
Failed: can't create session: could not connect to server: connection(): auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-256": (AuthenticationFailed) Authentication failed.
Tried two methods to take dump from the remote node. But got the same error in both the methods.
# Method 1
mongodump -h remoteip@port -u xxx -p xxx --db xxx --authenticationDatabase xxx
# Method 2
mongodump --uri "mongodb://username:password@remoteip:port/db?authSource=xxx"
How to resolve this?
For me (trying to use mongodump on a single node DB on the same host), using --authenticationDatabase admin
did the trick:
mongodump -u root --password 'secret' --authenticationDatabase admin -d mongo-dev -o /tmp/dump-2020-11-27.bson
(courtesy of mongodump from remote node - unable to authenticate using mechanism "SCRAM-SHA-256")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With