Regarding M201 Lab 1.1 :to Install Course Tools and Datasets

Getting below error in mongoimport --drop -c people --uri mongodb+srv://theusername:thepassword@m201-nhtgi.mongodb.net/m201 people.json

2020-06-28T20:09:22.629+0530 Failed: error connecting to db server: server returned error on SASL authentication step: Authentication failed.
2020-06-28T20:09:22.630+0530 imported 0 documents
I’m able to connect to server using the username/password in mongodb compass.

Regards,
Samir

It says authentication failure
May be because your command is too big to fit on single line
Try to split into multiple lines by using back slash ()

Hi @samira_patnaik,

I would recommend you to login to your Atlas Account. In your Atlas Cluster, click “Connect” and you will see the following screen:

Click on “Connect with the mongo shell” and copy the uri from there.

Use the same uri in the mongoimport command. Authetication related errors are due to wrong username or password.

If the issue still persists for you please share the screenshot of the complete mongoimport command that you have used and the error message that you are getting.

We can then debug the issue.

Kind Regards,
Sonali

I have installed mongodb as a service on my computer. But I am not able to connect to mongodb using port number from command prompt. I have specified the bin folder in path name and able to connect to mongob by just typing “mongo” in command prompt. But not able to connect when specifying port no. explicitly -

My bad, i was using port no. 27107 instead of 27017

1 Like