Ruby on rails Mongodb、mongoLab、Heroku(登台)和rails:身份验证失败

Ruby on rails Mongodb、mongoLab、Heroku(登台)和rails:身份验证失败,ruby-on-rails,mongodb,heroku,mlab,Ruby On Rails,Mongodb,Heroku,Mlab,我从事一个部署在Heroku上的项目,具有生产和暂存版本。当我想在登台时访问mongo shell时,写这一行:mongo-u-p(用我的信息重新放置)我有以下错误: 2016-12-21T11:34:43.861+0100 E QUERY [thread1] Error: Authentication failed. : DB.prototype._authOrThrow@src/mongo/shell/db.js:1441:20 @(auth):6:1 @(auth):1:2 exc

我从事一个部署在Heroku上的项目,具有生产和暂存版本。当我想在登台时访问mongo shell时,写这一行:
mongo-u-p
(用我的信息重新放置)我有以下错误:

2016-12-21T11:34:43.861+0100 E QUERY    [thread1] Error: Authentication failed. :
DB.prototype._authOrThrow@src/mongo/shell/db.js:1441:20
@(auth):6:1
@(auth):1:2

exception: login failed
它适用于生产,但不适用于暂存。 当我想用所有信息制作mongorestore时,我有一个错误:

Failed: error connecting to db server: server returned error on SASL authentication step: Authentication failed

有人能帮我吗

生产和暂存的MongoDB服务器版本是否不同?如果是这样,您可能需要不同版本的客户端工具。最好匹配主要版本以避免问题。例如,3.0.x服务器至少需要3.0.x客户端工具,3.2.x服务器至少需要3.2.x客户端工具,等等。

用于生产和暂存的MongoDB服务器版本是否不同?如果是这样,您可能需要不同版本的客户端工具。最好匹配主要版本以避免问题。例如3.0.x服务器至少需要3.0.x客户端工具,3.2.x服务器至少需要3.2.x客户端工具,等等。

要确保正确设置用户权限,请尝试传入您的authenticationDatabase
mongo-u“root”-p“123456”-authenticationDatabase

我不熟悉SASL设置,但有更多详细信息。

要确保正确设置用户权限,请尝试传入您的authenticationDatabase
mongo-u“root”-p“123456”-authenticationDatabase

我不熟悉SASL的设置,但是有更多的细节