Unable to connect to cluster with my shell for lab

Hi I am removing the placeholders in this code and typing it into the shell, but it is not connecting to the cluster -

mongo “mongodb+srv://:@.mongodb.net/admin”

mongo “mongodb://srv://m001-student:m001-mongodb-basics@sandbox.mongodb.net/admin”

The first statement is with the placeholder. The second statement is after I substituted the placeholder with values.

But it is still not connecting. Thank you. Please help.

The structure is wrong.

You have mongodb://srv://… which is wrong. Compare with the first one which is mongodb+srv://….

Hi Steeve,

Thank you for your response. It was a typo from my side. I used mongodb+srv://… and still it does not work. This question pertains to Chp 2 IDE space.

Here is the exact code that I am trying to use to connect to atlas cluster using the mongo shell -

mongo “mongodb+srv://m001-student:m001-mongodb-basics@sandbox.mlgeq.mongodb.net/admin”

It doesn’t work. Hence, any help would be appreciated. Thank you.

I suspect that either:

  1. you did not create m001-student as a database user on the cluster
  2. or you have another typo, on the user name or password

because the cluster part is running okay.

Hi Steeve,

Thank you for getting back to me. I think you are right. Even when I am copy pasting the code from atlas cluster to connect to sandbox -

mongo “mongodb+srv://sandbox.mlgeq.mongodb.net/myFirstDatabase” --username m001-student

It then prompts me to give the password which I say m001-mongodb-basics, it does not connect still.

Let me know where I should navigate in order to check my credentials for the cluster both username and password. Thank you.

Hi @Paul_Sujith_Rayi, welcome to the community.
Can you please confirm that you have whitelisted the IP and have allowed the access from anywhere?

Also, you can manage all your users under Security>Data Access>Users like mentioned in the below screenshot:

In case, you have any doubts, please feel free to reach out to us.

Thanks. Regards.
Sourabh Bagrecha,
Curriculum Services Engineer

1 Like

Hi Sourabh,

Thank you for this. Yes, I have whitelisted the IP address to allow access from anywhere. Coming to the users and database access. I was able to navigate and change the password to the default which is m001-mongodb-basics.

I will try to connect to my mongodb atlas cluster again from my shell now. Will keep you posted. Thank you.

Regards,
Paul

Hi Sourabh,

I tried it again by changing the password from the users pane and it worked this time. I was able to connect to the cluster through the shell. Thank you so much for all your help.

Regards,
Paul

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.