Can't connect to mongoDB Cluster from shell

0T11:08:16.063-0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-00-qgbhq.mongodb.net:27017
2019-09-30T11:08:16.064-0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-01-qgbhq.mongodb.net:27017
2019-09-30T11:08:16.064-0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-02-qgbhq.mongodb.net:27017
2019-09-30T11:08:16.407-0500 I NETWORK [ReplicaSetMonitor-TaskExecutor] Confirmed replica set for Cluster0-shard-0 is Cluster0-shard-0/cluster0-shard-00-00-qgbhq.mongodb.net:27017,cluster0-shard-00-01-qgbhq.mongodb.net:27017,cluster0-shard-00-02-qgbhq.mongodb.net:27017
2019-09-30T11:08:16.716-0500 I NETWORK [js] Marking host cluster0-shard-00-00-qgbhq.mongodb.net:27017 as failed :: caused by :: Location40659: can’t connect to new replica set master [cluster0-shard-00-00-qgbhq.mongodb.net:27017], err: AuthenticationFailed: bad auth Authentication failed.

*** It looks like this is a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network.

2019-09-30T11:08:16.986-0500 E QUERY [js] Error: bad auth Authentication failed. :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2019-09-30T11:08:16.997-0500 F - [main] exception: connect failed
2019-09-30T11:08:17.000-0500 E - [main] exiting with code 1

Hi @Mireille_33672,

It looks like you are entering incorrect password. Can you please try to connect using the connection string mentioned below?

mongo "mongodb+srv://cluster0-qgbhq.mongodb.net/test" --username m001-student -p m001-mongodb-basics

Hope it helps.

If the issue still persists, please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer