MongoDB get error as an the target machine activel

2019-07-18 10:39发布

问题:

This question already has an answer here:

  • Mongodb: Failed to connect to 127.0.0.1:27017, reason: errno:10061 17 answers

i'm newbie in mongodb and after installing mongo installer package on windows i get this error when i try to use mongo on shell and command prompt. i can not find any solution for this problem:

C:\Program Files\MongoDB 2.6 Standard\bin>mongo
MongoDB shell version: 2.6.7
connecting to: test
2015-02-20T16:43:11.971+0330 warning: Failed to connect to 127.0.0.1:27017, reas
on: errno:10061 No connection could be made because the target machine actively refused it.
2015-02-20T16:43:11.987+0330 Error: couldn't connect to server 127.0.0.1:27017 (
127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed

C:\Program Files\MongoDB 2.6 Standard\bin>

回答1:

You have to make sure that mongod is up and running.

Another probable cause would be that the port is not open.

I've come across the following thread on SO with multiple possible solutions to your problem --- LINK



标签: mongodb nosql