Search code examples
mongodbmongodump

mongodump from remote node - unable to authenticate using mechanism "SCRAM-SHA-256"


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.

Error Screenshot

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 admin

# Method 2
mongodump --uri "mongodb://username:password@remoteip:port/db?authSource=admin"

How to resolve this?


Solution

  • I had the same issue. In my case, the password has special characters. It works with single quote for password:

    -p 'my_password'