Installing mongodb in windows environment

Installing mongodb in windows environment
Facebooktwitterredditpinterestlinkedinmail

Step 1 : Download mongodb from mongodb website and extract files on your prefer location

Example : d:\mongodb\

Step 2 : In extracted file there is a directory bin it contain more than 10 excutable files.

Example : d:\mongodb\bin

Step 3 : Create a config file from notepad and save it in d:\mongodb\mongo.config and config file contain.

store data here
dbpath=D:\mongodb\data

all output go here
logpath=D:\mongodb\log\mongo.log

log read and write operations
diaglog=3

Step 4 : Now run the mongodb server from cmd by using “mongod.exe –config d:\mongodb\mongo.config”

Example : d:\mongodb\bin>mongod –config D:\mongodb\mongo.config

Step 5: Connect mongodb

Example : d:\mongodb\bin>mongo

Step 6 : Now install windows service so every time mongodbstart automatically

Example : D:\mongodb\bin> mongod –config D:\mongodb\mongo.config –install

Note : Change the drive volume according to your installation, I have used D: in all example its showing d:\mongodb\ like that if you installed mongodb in other drive like c: than d is must replace with c and so on.

Facebooktwitterredditpinterestlinkedinmail