无法将 Mongolab 与 MongodbShell 连接

Fail to connect Mongolab with MongodbShell

我正在尝试将 Mongo shell 与 Mongolab 连接起来。我正在使用我的 mongolab 用户名和密码,但出现错误:"Failed to connect to 54.81.180.188:56789."

我的用户名和密码是正确的。

我正在使用 Windows 8.1

当我 ping ds0-----.mongolab.com 时,一切正常。

     C:\mongodb\bin>mongo ds0----.mongolab.com:56789/dbname -u "MyUserName" -p "MyPassword"
MongoDB shell version: 3.0.3
connecting to: ds027751.mongolab.com:56789/dbname
2015-06-05T10:55:30.019+0530 W NETWORK  Failed to connect to 54.81.180.188:56789, reason: errno:10061 No connection could be made because the target machine actively refused it.
2015-06-05T10:55:30.024+0530 E QUERY    Error: couldn't connect to server ds027751.mongolab.com:56789 (54.81.180.188), connection attempt failed
    at connect (src/mongo/shell/mongo.js:181:14)
    at (connect):1:6 at src/mongo/shell/mongo.js:181
exception: connect failed

我遇到了同样的问题,我的服务器突然无法连接到 MongoLab。我联系了支持人员,他们发送了这条回复:

Hello,

Your Experimental Sandbox plan is running MongoDB 3.0.x, which includes changes to Mongo's authentication mechanism. This new mechanism is supported by certain newer driver versions, as described at http://docs.mongodb.org/manual/release-notes/3.0-scram/#upgrade-drivers.

To connect to this database, you will need to use one of the drivers listed at the above link.

Please let us know if you have questions about this.

Sincerely, Samson

我假设我是自动升级的,因为我已经几个月没有接触服务器代码或 MongoLab 了。作为即时修复,我刚刚在 MongoLab 中创建了一个新数据库,它是在 mongod v2.6.9 中创建的(我不记得看到过选择版本的选项)。