I'm trying to import a large data file in JSON format . I'm using
mongoimport --db verbs --collection de --file "/Users/marcelbraasch/Downloads/de.json"
to import the data. This is going through, however, I'm getting the following exception:
Failed: (Unauthorized) not authorized on verbs to execute command { insert: "de", ordered: false, writeConcern: { w: "majority" }, $db: "verbs" }
I already tried combinations like this
mongoimport -h localhost:27017 -u 'user' -p 'password' --db verbs --collection de --file "/Users/myname/Downloads/de.json"
but none of it worked. My mongo instance is running in a docker container, if this information matters. What do I need to do?
mongoimport --host="localhost" --port="27017" --username="user" --password="password" --db="verbs" --collection="de" --file="/Users/myname/Downloads/de.json"
now. This is throwingerror connecting to host: could not connect to server: connection() : auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-1": (AuthenticationFailed) Authentication failed.
. With the same credentials I can just log in usingmongo -u ... -p ...
. – Gownsman