Having difficulty connecting the cluster from the shell

mongodb%20help

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
ard-00-02-psa5r.mongodb.net.:27017,sandbox-shard-00-01-psa5r.mongodb.net.:27017/
test?gssapiServiceName=mongodb&ssl=true
2019-05-04T14:02:37.053+0200 E QUERY [js] Error: Authentication failed. :
connect@src/mongo/shell/mongo.js:343:13
@(connect):2:6
exception: connect failed

C:\Users\MALIMERCY>

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
test
MongoDB Enterprise Sandbox-shard-0:PRIMARY>