I just installed MongoDB version 4.2.23. I have a TAR.GZ backup that I have extracted. The extracted file has several BSON & JSON files. I am now trying to restore to a database using MongoRestore and the BSON files and am running into an error.
The command I tried is mongorestore -u $admin-p #password -d MongoDB --host=localhost:27017 acknowledgments.bson
After executing that I am getting the following message 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.
Any advice would be appreciated in doing a restore.
Update
I have created a user in the database I am attempting to restore. I created a user with the following command: db.create({user: "new_user", pwd: passwordPrompt(), roles: ["readWrite", "dbAdmin"]})
With the new user, I am trying to do the restore as the new user created using the following command: mongorestore -u $new_user_created -d MongoDB --host=localhost:27017 acknowledgments.bson
However I am still receiving the same error.
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.