Having difficulty connecting the cluster from the shell


Hello all,

I’m trying to connect the cluster from the shell but I keep getting this error message. Is there something I’m doing wrong such as putting my credentials in the wrong place? Thank you.

i am having the same problem, authentication failed,
even after entering the right right password : m001-mongodb-basics what could be the problem?
Microsoft Windows [Version 6.3.9600]
© 2013 Microsoft Corporation. All rights reserved.

C:\Users\MALIMERCY>mongo “mongodb+srv://sandbox-psa5r.mongodb.net/test” --userna
me m001-student
MongoDB shell version v4.0.9
Enter password:
connecting to: mongodb://sandbox-shard-00-00-psa5r.mongodb.net.:27017,sandbox-sh
2019-05-04T14:02:37.053+0200 E QUERY [js] Error: Authentication failed. :
exception: connect failed


You are already connected to mongo when you ran mongo --nodb
Exit the session and try again
It should work

Hi Emmanuel_Maliki_55656

Please check if you gave correct id/pwd
I am able to connect with the command you tried

C:\Users\ramrt\M001>mongo “mongodb+srv://sandbox-psa5r.mongodb.net/test” --username m001-student --password m001-mongodb-basics
MongoDB shell version v4.0.5
connecting to: mongodb://sandbox-shard-00-00-psa5r.mongodb.net.:27017,sandbox-shard-00-01-psa5r.mongodb.net.:27017,sandbox-shard-00-02-psa5r.mongodb.net.:27017/test?authSource=admin&gssapiServiceName=mongodb&replicaSet=Sandbox-shard-0&ssl=true
MongoDB server version: 4.0.9
MongoDB Enterprise Sandbox-shard-0:PRIMARY> db
MongoDB Enterprise Sandbox-shard-0:PRIMARY>