When i am trying to import json file data into mongodb atlas i am getting following error

error connecting to host: could not connect to server: connection() error occurred during connection handshake: auth error: sasl conversation error: unable to authenticate using mechanism “SCRAM-SHA-1”: (AtlasError) bad auth : authentication failed.

Can you connect to your cluster by shell?
Have you whitelisted your IP?
Are you giving correct user id/PWD?

1 Like

i was facing the same issue when i try to import using, look like some Security config enabled while hardening the password Encryption.

mongoimport -h $host --port 27117 -d <dbname> -c <coll_name> --type json --file collection.date.json

worked with the below approach


mongoimport --uri=$mongo_uri  -c <collection_name> --type json --file collection.data.json

not sure what the magic is. give a try

** Does your password contain special char?

1 Like

Thanks for the reply, but i solved it on my own by recreating the different cluster.

@Syed_Sheraz, your clueless answer seems to be coming straight out of ChatGPT’s mouth.

The issue is about is authentication failed.

Only ChatGPT would point to a formatting error of the JSON file.

Only ChatGPT would recommend to review the error message which is shared in the original post.

Only ChatGPT would recommend to consult the community forums in the community forums. Most likely because you did not tell ChatGPT that you were already in the community forums.

Anyway I am flagging you post since you trying to hide SPAM in it. I will also flag your other post for the same reason.