Mongorestore 问题 身份验证失败

A C*_*owe 5 mongodb

mongorestore -h ds121312.mlab.com:21312 -d heroku_jzxndzbk -u heroku_jzxndzbk -p xxxxxxxxxxxxxxx  dump/Loc8r
Run Code Online (Sandbox Code Playgroud)

错误:

2019-12-20T11:36:55.931-0500    error connecting to host: could not connect to server: connection() : auth error: sasl conversation error: unable to authenticate using mechanism "SCRA
M-SHA-1": (AuthenticationFailed) Authentication failed.
Run Code Online (Sandbox Code Playgroud)

我正在关注 Holmes/Harber 的“Getting MEAN”文本 - 第 152 页。

有什么建议?谢谢

Luc*_*age 6

您还必须指定用于身份验证的数据库,例如--authenticationDatabase admin.

参考:https : //docs.mongodb.com/manual/reference/program/mongo/#cmdoption-mongo-authenticationdatabase