How to connect to MongoDB in Windows?
Did you create the default db path?
It defaults to "/data/db
directory (or c:\data\db
on Windows)"
Source: http://www.mongodb.org/display/DOCS/Starting+and+Stopping+Mongo
I found that when I got this error it wasn't because I didn't have my default db path set up. It was because I was trying to run mongo.exe before running mongod.exe.
As Admin, create directory:
mkdir c:\mongo\data\db
As Admin, install service:
.\mongod.exe --install --logpath c:\mongo\logs --logappend --bind_ip 127.0.0.1 --dbpath c:\mongo\data\db --directoryperdb
Start MongoDB:
net start MongoDB
Start Mongo Shell:
c:\mongo\bin\mongo.exe