Lab - Importing a Dataset (Error)

Friends, please help me here!!!

Error: Failed: error connecting to db server: server returned error on SASL authentication step: Authentication failed.

Command I am running:
mongoimport --port 27000 -u m103-application-user -p m103-application-pass --authenticationDatabase applicationData /dataset/products.json

1 Like

Hi Syed_89964,

This leads me to check for two things: username/password should be correct and authenticationDatabase name should be correct.

--authenticationDatabase accepts the database name against which the user has been created which I believe should be admin database.

Please check and try again.

Kanika

1 Like

This way it worked for me
vagrant@m103:/dataset$ mongoimport -u m103-application-user -p m103-application-pass --collection products --authenticationDatabase admin --db applicationData --port 27000 products.json
2019-01-14T18:04:42.131+0000 connected to: localhost:27000

2019-01-14T18:05:02.482+0000 imported 516784 documents
vagrant@m103:/dataset$
Verify:
vagrant@m103:/dataset$ wc -l products.json
516784 products.json

MongoDB Enterprise > db.products.count()
516784

This way it works. However, the instruction says to import data in “applicationData”.
So is the validate successful?

Yes successful
It is importing into applicationData only
We are using admin to authenticate

OK! I got the point now!! Thanks a lot

Remember in the previous lab, we created the application user in the admin database.

1 Like

@Ramachandra_37567
Excellent:
thank you for the help.

Best regards