The following is reproduced from the http://be-evil.org/install-mongodb-on-windows7.html
1. Download The MongoDB database for Windows
Go to the official download page to download the MongoDB Windows version. You can choose either 32-bit or 64-bit based on your own needs.
Http://www.mongodb.org/downloads
2. Installation preparation
Decompress the downloaded package to the desired location, and create a folder named dband A log.txt file under the directory.
The DB folder is used to store databases.
Log.txt is used to record MongoDB logs
3. Install MongoDB
The method described here is to install MongoDB as a Windows Service and open the windows command line (Note: Use the administrator privilege to start the command line) and move it to the bin folder under your MongoDB directory. The path I demonstrated here is D: \ Dev \ env \ MongoDB.
Run the following command to register MongoDB as a Windows Service:
Mongod.exe -- install -- logpath = D: \ Dev \ env \ MongoDB \ log.txt -- dbpath = D: \ Dev \ env \ MongoDB \ DB
-- The install parameter is used to set the installation as a server.
-- Logpath setting is the setting of the log file. log.txt is the file created in the previous step.
-- The dbpath parameter is used to set the path for storing database files. The DB folder has been created in the previous step.
The execution result is as follows:
Enter
Net start MongoDB
You can start the MongoDB service.
After startup, enter
Mongo
If you successfully enter the Mongo shell environment, it indicates that MongoDB has been installed successfully.