100% found this document useful (1 vote)
23 views

MongoDB Installation Process

The document provides steps to install and configure MongoDB on Windows: 1. Download and extract the MongoDB zip file to a MONGO folder on the C drive. Create a Data/DB subfolder for data storage. 2. Open the command prompt as Administrator and navigate to the bin folder. Run mongod to start the database server. 3. Run mongo.exe to open the administrative shell and perform queries. Additional steps are given to install MongoDB as a Windows service for automatic startup, including service configuration options.

Uploaded by

Yakub Pasha
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
23 views

MongoDB Installation Process

The document provides steps to install and configure MongoDB on Windows: 1. Download and extract the MongoDB zip file to a MONGO folder on the C drive. Create a Data/DB subfolder for data storage. 2. Open the command prompt as Administrator and navigate to the bin folder. Run mongod to start the database server. 3. Run mongo.exe to open the administrative shell and perform queries. Additional steps are given to install MongoDB as a Windows service for automatic startup, including service configuration options.

Uploaded by

Yakub Pasha
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Getting started with Mongo DB

 Download the setup from following link:

  http://www.mongodb.org/display/DOCS/Downloads

 The downloaded file would be in .ZIP format. Need to extract the file and
save it in C:\MONGO (Create new folder called MONGO and save the file)
 Create another folder in C drive with the name ‘Data’ and a sub folder as
‘DB’ (i.e., C:\Data\DB).
 By default MONGODB will store data in \Data\DB, but it won't
automatically create that folder, that’s why we have to create the folders.
 Click on the Start Menu and enter "cmd" in the search box. Right-click on
cmd.exe and select "Run as Administrator." This is very important
because without admin rights MongoDB might not work properly.
 System will display command prompt window then type “cd
c:\mongo\bin” and press enter.
 Type mongod (Mongod is the Database Server) and again press enter to
connect to the Mongo database server. (Do not close the Command
Prompt Window of this connection)
 With the above step, the system will establish the connection to MONGO
database server. Minimize the command prompt.
 To open the Administrative Shell, Run the Command Prompt as
Administrator, and then traverse to the path “C:\mongo\bin” through the
command prompt and type “mongo”. Or simply explore the \mongo\bin
and click on the ‘Mongo.exe’ file.
 The main use of Administrative shell is to perform the Query Operations.

INSTALLING MONGODB AS A SERVICE ON WINDOWS 7

 Run the command Prompt as Administrator and then navigate to the


following directory in the command prompt: C:\mongo\bin

 The service related commands are:


mongod --install
mongod --service
mongod --remove
mongod --reinstall
 You may also option pass the following to --install and --reinstall
--serviceName {arg}
--serviceUser {arg}
--servicePassword {arg}

 For installing MongoDB as a Windows Service, follow the below procedure:

 The --install and --remove options install and remove the mongo daemon
as a windows service respectively. The --service option starts the service.
--reinstall will attempt to remove the service, and then install it. If the
service is not already installed, --reinstall will still work.
 Both --remove and --reinstall will stop the service if it is currently running.
 To change the name of the service use --serviceName. To make mongo
execute as a local or domain user, as opposed to the Local System
account, use --serviceUser and --servicePassword.
 Whatever other arguments you pass to mongod.exe on the command line
alongside --install are the arguments that the service is configured to
execute mongod.exe with.
 For example the following command line:
 mongod --bind_ip 127.0.0.1 --logpath d:\mongo\logs --logappend
--dbpath d:\mongo\data --directoryperdb --install
 Will cause a service to be created called Mongo that will execute the
following command:
 mongod --bind_ip 127.0.0.1 --logpath d:\mongo\logs --logappend
--dbpath d:\mongo\data –directoryperdb

This finishes the creation of the windows service for the MongoDB database.

For any help, please refer to the following links:

http://www.mongodb.org/display/DOCS/Quickstart+Windows
http://www.mongodb.org/display/DOCS/Windows+Service

You might also like