To reproduce, launch a mongod instance with a username / password (jim and password in this case).
UNIX session
$ cat << EOF > password.json
heredoc> password
heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acae" } }
heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acaf" } }
heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acb0" } }
heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acb1" } }
heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acb2" } }
heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acb3" } }
heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acb4" } }
heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acb5" } }
heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acb6" } }
heredoc> EOF
$ mongoimport --drop --db my_cms --collection docs --username jim --password --authenticationDatabase admin < password.json
connected to: 127.0.0.1
Enter password:
Fri Dec 12 11:02:05.917 dropping: my_cms.docs
Fri Dec 12 11:02:05.921 imported 9 objects
Windows session
C:\jim>mongoimport --host XX.XX.XX.XXX -username jim --password --authenticationDatabase admin --db my_cms --collection docs < password.json
connected to: 10.7.31.244
Enter password: Cannot get console mode 6
assertion: 18 { code: 18, ok: 0.0, errmsg: "auth fails" }
- is duplicated by
-
TOOLS-682 Mongodump no longer asks for password when used with -p without args
-
- Closed
-