There are still many tutorials on the Internet, and the installation is smooth.
Installation files: Official Website http://www.mongodb.org/downloads
Select the file corresponding to your system.
1. decompress the file.
Decompress the package. My directory is E: \ mongdb
2. Create a working directory.
1. Create a data storage directory e: \ MongoDB \ data \ DB
2. Create a log file E: \ MongoDB \ log \ MongoDB. Log
3. Start the mongdb service.
Go to the decompressed working directory on the console and enter the command
E:\mongodb\mongodb\bin>E:\mongodb\mongodb\bin\mongod.exe --dbpath=E:\mongodb\data\db
The following content should be displayed during normal operation
Thu Apr 12 00:24:39 [initandlisten] MongoDB starting : pid=6832 port=27017 dbpath=E:\mongodb\data\db 64-bit host=chen-PCThu Apr 12 00:24:39 [initandlisten] db version v2.0.4, pdfile version 4.5Thu Apr 12 00:24:39 [initandlisten] git version: 329f3c47fe8136c03392c8f0e548506cb21f8ebfThu Apr 12 00:24:39 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_42Thu Apr 12 00:24:39 [initandlisten] options: { dbpath: "E:\mongodb\data\db" }Thu Apr 12 00:24:39 [initandlisten] journal dir=E:/mongodb/data/db/journalThu Apr 12 00:24:39 [initandlisten] recover : no journal files present, no recovery neededThu Apr 12 00:24:40 [initandlisten] waiting for connections on port 27017Thu Apr 12 00:24:40 [websvr] admin web console waiting for connections on port 28017
The default listening port of mongdb is 27017.
If no request information exists, mongdb displays a message every five minutes.
Thu Apr 12 00:25:40 [clientcursormon] mem (MB) res:21 virt:82 mapped:0Thu Apr 12 00:30:40 [clientcursormon] mem (MB) res:21 virt:79 mapped:0Thu Apr 12 00:35:40 [clientcursormon] mem (MB) res:21 virt:79 mapped:0Thu Apr 12 00:37:19 [initandlisten] connection accepted from 127.0.0.1:63584 #1Thu Apr 12 00:40:40 [clientcursormon] mem (MB) res:21 virt:80 mapped:0Thu Apr 12 00:45:40 [clientcursormon] mem (MB) res:21 virt:80 mapped:0
4. Use mongdb as a Windows Service for random startup.
1. Enter the command.
E:\mongodb\mongodb\bin>E:\mongodb\mongodb\bin\mongod.exe --dbpath=E:\mongodb\data\db --logpath=E:\mongodb\logs\mongodb.log --install
Correctly display the following content
all output going to: E:\mongodb\logs\mongodb.log
2. Start the service and enter the command.
net start mongodb
5. Verify the connection on the client.
Open a new cmd window and enter the command.
E:\mongodb\mongodb\bin\mongo
Will output the following content
MongoDB shell version: 2.0.4connecting to: test
Haha, start!