Everyone is loving NoSQL and mainly MongoDB. I thought to start getting my hand dirty on this. So to start with downloaded MongoDB for Windows and installed it. So far so good.

Next I browsed to MongoDB folder. To start server typed mongo.exe command. Oops encountered following error that could not connect to server.

clip_image001

Okay so to start using mongoDB first we need to start mongoDB server. That can be done as by using command mongod. So I tried starting mongoDB server using mongod command. Oops again I got following error which clearly says dbpath does not exist.

image

So let us go ahead and create a folder data\db. We are free to create this folder at any location. However later this folder location should be set with dbpath for mongoDB.

clip_image006

Once data folder is created we need to set dbpath which can be done as follows,

clip_image008

It will take some time to get this command executed. You will notice that there is no error encountered.

Command prompt should stopped at

clip_image009

Next launch another command prompt and type command mongo.exe

clip_image011

Here you see mongoDB is connected to database test. To test successful installation, let us insert one record in test database. To insert command is db.test.save(jsonvalue) where test is your database.

clip_image013

After doing these steps mongoDB is installed successfully on your Windows Machine. I hope this post is useful. Thanks for reading.

Advertisements

One thought on “Problem starting mongoDB server on Windows 8? Resolved

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s