Authentication failed type

Hi
This is kishan
while connecting to mongodb it is showing authentication failed can anyone help with this
thankyou

May be the login credentials are not correct
Make sure no extra spaces

Hi kishan_15003,

Don’t copy/paste the password as there might be a chance that whitespace or some special character is appended.

username: m001-student
password: m001-mongodb-basics

Also, try connecting from command-line using the following connection string: be careful about the double quotes, just replace them after pasting to the command line:

  mongo "mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/100YWeatherSmall?replicaSet=Cluster0-shard-0" --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics

Let me know if you still face any issue.

Kanika

It looks like there is a space at the beginning of the username

2 Likes