Cant connect Atlas using commands in the lecture

I have created a cluster before on mongodb Atlas , so now my connection string is not the same as any of you guys. And I’m confused whether to edit the string or connect not , either way the IDE cant connect to atlas. Please help

Hi @Glenda_Mabasa, welcome to the community.
All you have to do is create a new database user for your cluster.
You can manage Atlas Users by clicking on the Database Access link in the sidebar under the security section.

After clicking on the link, you would see an interface like this:

If you don’t have a user with the name as “m001-student” & password as “m001-mongodb-basics’ ’ please create one and replace it within the connection string placeholders whenever you want to connect with your cloud cluster from the shell.

I hope it helps, also, please take a look at this FAQ post. Happy Learning!

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

Thanks and Regards.
Sourabh Bagrecha,
Curriculum Services Engineer

I just created a new user, and the connection string still doesnt have the details of the new user I created. In terms of replacing the placeholders, how exactly should I do that?

1.what portion of the connection string should I paste on the IDE (What must I replace and with what)
2.After pasting the password aswell do I press run test or enter on my keyboard? (because Im getting errors)

Hi @Glenda_Mabasa,

Connection string produced by Atlas will never contain your credentials, take a look at the following example:

mongo "mongodb+srv://xyzx.abcde.mongodb.net/myFirstDatabase" --username <username>

Now you have to replace the <username> with the username of your user.
On pressing enter, you will be asked to enter the password, once you have entered your password please press enter/return key on your keyboard.
Once the connection is successful, you can run the test.

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

Thanks and Regards.
Sourabh Bagrecha,
Curriculum Services Engineer

1 Like

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