Reputation: 79
After calling command mongodb.exe the error message says:
Could not connect to 127.0.0.1:27017, reason: errno:10061 No connection can be made because the target machine actively refused it. Blockquote
I wonder how to deal with this.
Upvotes: 1
Views: 126
Reputation: 238
Try to add configuration path like this:
To start the server :
C:\mongodb\bin\mongod.exe --dbpath "path_to_directory_to store_data
"
And to connect to Mongo:
C:\mongodb\bin\mongo.exe
If this doesnt work try apply this method:
or try this:
MongoDB on a Windows 7 machine: No connection could be made
Upvotes: 1
Reputation: 21692
The error you are getting suggests you are running the shell (mongo.exe
) rather than the database (mongod.exe
). The shell will, by default, attempt to connect to the database - in other words it will essentially do what you state you wish to do with python.
You can either run the mongod.exe
manually with appropriate options, or you can install it as a service. In either case, there are detailed instructions on how to do this here:
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/
Upvotes: 0