0
votes

I am trying to export data from a mongodb cluster to my computer, using my URI connection string, but am getting the error: could not connect to server: connection() : auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-S HA-1": (AtlasError) bad auth Authentication failed

This is the command I am using:

mongoexport --uri="mongodb+srv://yash_verma:<******>@jspsych-eymdu.mongodb.net/test?retryWrites=true&w=majority" --collection=entries --out=entries.csv 

Could anyone tell me what it is that I am doing wrong? I am sure I am using the correct password.

I am also fairly new to programming and have tried to look online for a solution, but haven't found one yet.

Any help would be greatly appreciated.

Thanks, Yash.

1
Btw my username is 'yash_verma', my db is 'test' and my collection is 'entries'.Yash Verma

1 Answers

0
votes

Your connection string looks fine, but make sure to remove the angle brackets (<>) around <password>, like so:

mongoexport --uri="mongodb+srv://yash_verma:******@jspsych-eymdu.mongodb.net/test?retryWrites=true&w=majority" --collection=entries --out=entries.csv 

…where ****** is the database password (not the account password!) of the database user yash_verma.

Duplicate answer