0

I want to use mongoimport CLI.

The command succeeds when I use admin database. If the database is something else (whether database exists or not) it fails.

I am using root credentials, but authentication fails.

mongoimport --host=$DB_HOST:$DB_PORT
            --username=$DB_ROOT_USERNAME
            --password=$DB_ROOT_PASSWORD
            --db=$DB_NAME                   <--- here
            --collection=$DB_COLLECION
            --file=output.csv
            --type=csv

2021-11-14T15:47:14.507+0000    error 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.

Why can't I use another database than admin ?

Tiino
  • 78
  • 9
  • Check here, similar issue: https://www.mongodb.com/community/forums/t/unable-to-authenticate-using-mechanism-scram-sha-1/86151/16 – Eskiso Nov 14 '21 at 16:24
  • See https://stackoverflow.com/questions/63754742/authentication-failure-while-trying-to-save-to-mongodb/63755470#63755470 - it applies also for mongimport – Wernfried Domscheit Nov 14 '21 at 18:53

0 Answers0