New to MongoDB Can not run command mongo
Solution 1:
After installing the MongoDB you should manually create a data folder.
By default MongoDB will store data in /data/db, but it won't automatically create that directory. To create it, do: $ sudo mkdir -p /data/db/ $ sudo chown `id -u` /data/db You can also tell MongoDB to use a different data directory, with the --dbpath option.
For more detailed information go to MongoDB wiki page.
Solution 2:
I think your log output states it clearly;
exception in initAndListen: 10296 dbpath (/data/db) does not exist, terminating
You may simply create this directory or better to define it as a configuration value within your configuration file then use it as mongod -f C:\path\to\your\mongodb.conf
.
Solution 3:
Specify the database path explicitly like so, and see if that resolves the issue.
mongod --dbpath data/db
Solution 4:
mongod --dbpath "c://data/db"
run the above code, this will start the server.
Solution 5:
For Windows 7
You may specify an alternate path for \data\db
with the dbpath setting for mongod.exe,
as in the following example:
c:\mongodb\bin\mongod.exe --dbpath c:\mongodb\data\db
or
you can set dbpath through Configuration File.