Cuelogic Blog Icon
Cuelogic Career Icon
Home > Blog > All > Install MongoDB on Windows

Install MongoDB on Windows

It is vary easy to install mongodb on your windows.  You need  to just follow the given steps bellow and done.

Download Mongodb setup zip  from following link:

http://www.mongodb.org/downloads

Set up folder structure:

1. Extract downloaded zip file.

2. Open that extracted setup folder.

 

3. Copy all files under “bin” folder.

4. Create folder on your machine with name “mongodb”.

5. Paste all files under that folder.

6. Create folder with name “data” in “mongodb” folder.

7. Create one more folder with name “db” in “data” folder.

Start mongodb server:
Open command prompt and navigate to the “mongodb” folder and run “mongod.exe”. It will start your mongodb server.

D:\mongodb\>mongod.exe

Some people may find following issue after executing mongod.exe.

ERROR: dbpath (data\db) does not exist.
Create this directory or give existing directory in --dbpath.
See http://dochub.mongodb.org/core/startingandstoppingmongo

That is because of database  default storage path not set. Use following command to set your database path and run mongodb server.

D:\mongodb>mongod --dbpath \data\db

Connect to the server:
Open another command prompt and navigate to the “mongodb” folder and run “mongo.exe”. It will connect to your mongodb server and you can check or perform the db related activites here.

D:\mongodb\>mongo

Reference Link:

View Video