2

I recently started the mongodb service on my windows machine, and it is running succesfully. Or at least I think it is, though I am not 100% sure and I don't know what port it is running on because all attempts to check the status have failed. When I try to run mongo.exe, I get the following error:

paul@PAUL_LAPTOP /c/program files/mongodb 2.6 standard/bin
$ mongo
MongoDB shell version: 2.6.3
connecting to: test
2014-08-11T03:36:15.802-0400 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.
2014-08-11T03:36:15.808-0400 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

Any ideas how I could check why this is happeing? One good first step would be checking the status of my mongo service, which I am not sure how to do.

Any help is greatly appreciated.

Thanks,

Paul

Paul
  • 910
  • 1
  • 11
  • 34

2 Answers2

0

Have you gonbe through all the steps here: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/?

You need to run the mongod command to start mongodb, and you also have to define the path where mongodb shall store your database:

C:\mongodb\bin\mongod.exe --dbpath d:\test\mongodb\data
Mofodev
  • 1
  • 2
  • Hi mofodev, yes I should have mentioned that I followed the steps on that site. Actually I tried installing it the regular way but it didn't work, so then I followed the other steps to set up mongo as a service, which involves configuring a log folder and a database path. I started the service and it says it is running succesfully. Still can't connect – Paul Aug 11 '14 at 13:45
  • What were the errors when you tried to install it the "regular way"? Have you checked the service is running with the services window or processes window? Also try checking what ports the mongod process is listening on. See [this SO answer](http://stackoverflow.com/questions/48198/how-can-you-find-out-which-process-is-listening-on-a-port-on-windows) for how to do that. Can you post your config file/command line options as well? – wdberkeley Aug 19 '14 at 15:40
0

When you typed in the mongod command, did you also give it a path? This is the step beforehand and this is usually the issue.

mongod --dbpath="put your path to where you want it to save the working area for your database here!! without these silly quotations marks I may also add!"

example: mongod --dbpath=C:/Users/Kyle-3/Desktop/DEV/dangerzonearea/test/mongodb

That is my path and don't forget if on windows to flip the slashes forward if you copied it or it won't work!

Urasquirrel
  • 1,025
  • 1
  • 13
  • 31