How to Install MongoDB on Windows


MongoDB is a cross-platform document-oriented database. Its a NoSQL database.
MongoDB support unstructured data .

Today we will learn how to install MongoDB on windows. I giving step by step instructions.

Step 1. Download MongoDB installer or zip file from from http://www.mongodb.org/downloads.
MongoDB provide two types of version 32 bit and 64 bit.

32-bit versions of MongoDB only support databases smaller than 2GB its suitable only for testing purposes.

Step 2. MongoDB Inc. give many option to download MongoDB database its installer or zip file. But MongoDB Inc. recommend installer.

Step 3. Now Install MongoDB or extract zip file in c:\\drive.

Installer will install MongoDB into your windows default drive. like "C:\\" drive

In my system its showing
C:\Program Files\MongoDB\Server\3.0\bin

Step 4. Copy MongoDB file path like "C:\Program Files\MongoDB\Server\3.0\bin"

Step 5. Now start command prompt in administrator mode

and go to MongoDB bin like

"C:\Program Files\MongoDB\Server\3.0\bin" into command line



Step  6. Now create a folder for database into bin folder . I am creating "data" folder for MongoDB database

then run following command.

C:\Program Files\MongoDB\Server\3.0\bin>mongod --dbpath "data"

If command run successfully it will show you

2015-05-28T10:35:23.086+0530 I NETWORK  [initandlisten] waiting for connections
on port 27017

Message on bottom. Its means MongoDB run successfully and waiting to connect a connections.

Now check inside of "data" folder MongoDB created a default "local" database

local.0
local.ns

Step 7. Now open a new command prompt and go to MongoDB bin folder and run "mongo" command.

It will connect you MongoDB database

MongoDB shell version: 3.0.1
connecting to: test

MongoDB Installed successfully ! Enjoy

 

Comments