Fail to connect Mongolab with MongodbShell

廉价感情. 提交于 2019-12-06 09:23:41

问题


I'm trying to connect the Mongo shell with Mongolab. I am using my mongolab username and password but it is giving an error: "Failed to connect to 54.81.180.188:56789."

My userName and password is correct.

I'm using Windows 8.1

When I ping ds0-----.mongolab.com that's working fine.

     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

回答1:


I had the same problem, my server abruptly lost the ability to connect to MongoLab. I contacted support, who sent this reply:

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

I assume I was upgraded automatically, as I hadn't touched the server code or MongoLab in months. As an immediate fix, I just created a new db in MongoLab, which was created in mongod v2.6.9 (I don't remember seeing an option to choose the version).



来源:https://stackoverflow.com/questions/30659213/fail-to-connect-mongolab-with-mongodbshell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!