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