Server returned error on SASL authentication step: Authentication failed - MongoDB

Server returned error on SASL authentication step: Authentication failed - MongoDB

* Solution

  1. Check your credentials

  2. Password has a special character like $. Solution: single quote the password field 'pass$word'

  3. Use --authenticationDatabase

mongodump --host <host> --port <port> --username <user> --password "<pass>" --authenticationDatabase admin --db dbToExport --out <path>/mongodump-<date>