Install MongoDB on Windows

Source: Internet
Author: User
Tags how to install mongodb on windows install mongodb mongodb server
This article describes how to install MongoDB on Windows 7.

Note: Unlike installing other software on Windows, MongoDB only needs to download the zip package, decompress it, configure the data storage directory, and start it.

1. Download MongoDB

On the official MongoDB website, select the corresponding windows compressed package based on your platform and decompress the package. In this article, decompress the package to D: \ MongoDB \.

 

Note: To quickly use the commands in the MongoDB bin directory in the command line, you can add D: \ MongoDB \ bin to The Window environment variable.

2. Configure the data file

Create the Mongo. config file in D: \ MongoDB \, as shown below (and create a data and log folder in the D: \ MongoDB directory) # data storage location
Dbpath = D: \ MongoDB \ data
 
# All output locations
Logpath = D: \ MongoDB \ log \ Mongo. Log
 
# Log read/write operations
Diaglog = 33. Run MongoDB Server

In the command control line, switch to the D: \ MongoDB \ bindirectory and use the command mongod.exe -- config D: \ mongdb \ Mongo. config to start the MongoDB server. D: \ MongoDB \ bin> mongod.exe -- config D: \ MongoDB \ Mongo. config
All output going to: D: \ MongoDB \ log \ Mongo. log4. connect to MongoDB

You can use cmd.exe to connect to the MongoDB server.

5. Set MongoDB as a Windows Service

In the command line control window, add the -- install option to install MongoDB as a Windows service. D: \ MongoDB \ bin> mongod.exe -- config D: \ MongoDB \ Mongo. config

The command to start MongoDB is: Net start MongoDB

The command for stopping MongoDB is: net stop MongoDB

The command for deleting MongoDB is mongod -- remove.

Original article, reprinted Please note:Reprinted from http://www.qiyadeng.com/

Link:Install MongoDB on Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.