Wednesday, February 3, 2010

MongoDB as a Service on Windows

If you're going to install MongoDB as a service on Windows, then remember to include the whole path name when you do the command. Also set your dbpath and anything else you want to do at this point.

C:\mongodb\bin\mongod --dbpath c:\path\to\db --install

And if you're like me, and have already tried it without the full path, you can either uninstall the service (sc delete MongoDB) and reboot your computer, or look up the registry and edit the path key (HKEY_LOCAL_MACHINES\SYSTEM\CurrentControlSet\Services\MongoDB\ImagePath).

Unfortunately, the --remove option only seems to disable the service, not actually remove it.

I wish I'd had the good sense to edit the registry key, instead of deleting it with the hope of not having to reboot.

1 comment: