Member-only story

mongoexport show unable to authenticate using mechanism

“SCRAM_SHA-1” so how to fix it.

Donald Le
Nov 20, 2021
Photo by David Gavi on Unsplash
  • Before command
mongoexport --uri=mongodb://account:password@domain:port/db --collection collection_name --out output.json2021-11-20T17:04:01.983+0700 could not connect to server: connection() error occured during connection handshake: auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-1": (AuthenticationFailed) Authentication failed.
  • After command and it works
mongoexport --uri=mongodb://account:password:port/db --collection collection_name --authenticationDatabase admin --out output.json2021-11-20T17:07:26.152+0700 connected to: mongodb://[**REDACTED**]@domain:port/db
2021-11-20T17:07:27.191+0700 [........................] db.collection 0/870 (0.0%)
2021-11-20T17:07:28.055+0700 [########################] db.collection 870/870 (100.0%)
2021-11-20T17:07:28.055+0700 exported 870 records

Hope it helps~~

Happy coding~~

--

--

Donald Le
Donald Le

Written by Donald Le

A passionate automation engineer who strongly believes in “A man can do anything he wants if he puts in the work”.

No responses yet