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 ?