Failed: error connecting to db server: server returned error on SASL authentication step: Authentica

mongdb database can not be backed up after adding user name and password, it has been suggested that the verification failed. Finally found that their database password with a special character reason.

Failed: error connecting to db server: server returned error on SASL authentication step: Authentication failed.

The solution given on

network is to add — authenticationDatabase, but I still can’t add it.

~ $ mongodump -h 127.0.0.1 --port 27017 --authenticationDatabase manager -u LorettaLei -p LorettaLei$001 -o db        

2019-11-26T16:30:21.206+0800    Failed: error connecting to db server: server returned error on SASL authentication step: Authentication failed.

finally figured out that it might be because I had a special character in my password. I put a backslash before the special character, and it succeeded immediately. I was so clever!

Read More: