Unable to connect to cluster using mongo shell

I am facing an issue while connecting to Atlas cluster via mongo shell.
I am using this command -
mongo “mongodb+srv://cluster0-jxeqq.mongodb.net/test” --username m001-student -password m001-mongodb-basics

and getting error as below:

Need help on resolving this issue.

Please Note: I am able to telnet to host and port of atlas cluster and able to make outgoing requests to all these three node

Try using single quotes.

Hi @Bhavna_Gyanchandani,

It looks like you are using a fairly old version of MongoDB server i.e. 3.2.0 . I would highly recommend you to install the latest version because a lot of new features has been introduced in MongoDB since version 3.2.

I think the srv type connection string would not work.

Select mongo shell version 3.4 or earlier and use that connection string.

~ Shubham

1 Like

I have the same problem like above even after using 3.4 version earlier string for my own sandbox cluster. I face the same problem even while connecting to Atlas cluster. Can you please help me.

Although I have problems connecting through Mongoshell. I’m able to connect through Pymongo. I have attached my screenshot aslo. Please let me know why it is not working through mongoshell.

Hi @Allen_Rajiv,

What connection string are you using in mongo shell ?

~ Shubham

This worked for me. I have upgraded the MongoDB version to 4.4 i.e. latest as per Shubham’s suggestion and it worked perfectly fine. Infact, I wasn’t required to change the SRV type connection string, upgrading the MongoDB version worked. Thank you!

@Allen_Rajiv - Could you please confirm if you have gone through the steps from Chapter 0 - Setup - Lecture - Are you behind a firewall.
you could also try upgrading the mongodb version that worked in my case.

A post was merged into an existing topic: Connection to atlas cluster from shell