• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

How to install MongoDB

How to install MongoDB

In this tutorial, we will show you how to install MongoDB on Windows.

MongoDB 2.2.3

Windows 7

Note: The MongoDB does not require installation, just download and extracts the zip file, configure the data directory and start it with command “mongod“.

1. Download MongoDB

Download MongoDB from official MongoDB website. Choose Windows 32 bits or 64 bits. Unzip, extracts to your prefer location, for example : d:\mongodb\.

2. Review MongoDB folder

In MongoDB, it contains only 10+ executable files (exe) in the bin folder. This is true, and that are the required files to MongoDB, it’s really hard to believe for a developer like me who come from a relation database background.

Figure : Files under $MongoDB/bin folder

Screenshot_2

Note:It’s recommended to add $MongoDB/bin to Windows environment variable, so that you can access the MongoDB’s commands in command prompt easily.

3. Configuration File

Create a MongoDB config file, it’s just a text file, for example : d:\mongodb\mongo.config

Screenshot_3

Note: MongoDB need a folder (data directory) to store its data. By default, it will store in “C:\data\db“, create this folder manually. MongoDB won’t create it for you. You can also specify an alternate data directory with --dbpath option.

Aspired to become an MongoDB?
Explore the post to discover the know-hows on MongoDB.

4. Run MongoDB server

Use mongod.exe --config d:\mongodb\mongo.config to start MongoDB server.

Screenshot_4

5. Connect to MongoDB

Uses mongo.exe to connect to the started MongoDB server.

Screenshot_5

6. MongoDB as Windows Service

Add MongoDB as Windows Service, so that MongoDB will start automatically following each system restart.

Install as Windows Service with --install.

Screenshot_6

A Windows service named “MongoDB” is created.

Screenshot_7

Screenshot_8

7. FAQs

1. Install MongoDB as Windows service on Windows 8, but hit “Access is denied.” error message :

Screenshot_9

To fix it, run the Command Prompt with Administrative Privileges – right click on the command prompt icon, select run as administrator.

Other Interesting Reads

Summary
Review Date
Reviewed Item
How to Install MongoDB
Author Rating
5

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on How to install MongoDB"

Leave a Message

Your email address will not be published. Required fields are marked *

Site Disclaimer, Copyright © 2016 - All Rights Reserved.