0

when doing the m103 mongodb course i came across this error when doing the import lab:

user@NHTTPR# mongoimport /dataset/products.json -h localhost:27000 -u m103-application-user -p “m103-application-pass” --authenticationDatabase admin --db applicationData --drop --collection products

2021-04-07T06:19:23.616+0000 error connecting to host: could not connect to server: connection() : auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-256": (AuthenticationFailed) Authentication failed.

2 Answers 2

3

the solution was to put single quotes (') around the password. instead of double quotes ( or remove the quotes around the password entirely)

mongoimport /dataset/products.json -h localhost:27000 -u m103-application-user -p 'm103-application-pass' --authenticationDatabase admin --db applicationData --drop --collection products 2021-04-07T06:20:25.025+0000 connected to: mongodb://localhost:27000/ 2021-04-07T06:20:25.026+0000 dropping: applicationData.products 2021-04-07T06:20:25.423+0000 9966 document(s) imported successfully. 0 document(s) failed to import. user@NHTTPR#

Sign up to request clarification or add additional context in comments.

Comments

0

use single quote or dont use any quotes following works

mongoimport --username m103-application-user --password m103-application-pass --port=27000 --authenticationDatabase admin --db applicationData --drop --collection products /dataset/products.json

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.