Cannot to the class atlas cluster from the mongo shell

I trying to use the following commands

mongo “mongodb+srv://cluster0-jxeqq.mongodb.net/test” --username m001-student -password m001-mongodb-basics

I thought maybe the above command needs a one ‘-’ more so I modified
mongo “mongodb+srv://cluster0-jxeqq.mongodb.net/test” --username m001-student --password m001-mongodb-basics

But the same errors appears

error_connect_mongodb

I also tried the following string connection:

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/test?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics

Becasuse of this advice “Starting in MongoDB version 4.2, the ssl option has been deprecated and the new corresponding tls option has been added”, I modified the string to:

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/test?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --tls --username m001-student --password m001-mongodb-basics

My versión is 4.2.5.

Thanks in advance for your help.

Please the first command you fired in your snapshot
You are at mongo prompt when you fired mongo and you are trying to connect to Class cluster
It won’t work
Please exit and run from your os prompt
Are you not using Vagrant?

1 Like

Thank you! It works!

Closing this thread as the issue has been resolved.