1. Download the Windows version of MongoDB, including the 32-bit and 64-bit versions (of which the Linux version is also available). Download the version based on the system conditions. :Http://www.mongodb.org/downloadsHere I downloaded the mongodb-win32-i386-2.4.0-rc1.
2. decompress the package to any hard disk partition directory, such as D:/DB/MongoDB, and create a storage location for database files in any location, such as D: /DB/MongoDB/dB (You must create a folder for storing database files before starting the MongoDB service. Otherwise, the command will not be created automatically and cannot be started successfully. The default folder path is C :/Data/DB. Use SystemWhen the default folder path is used, you do not need to add the -- dbpath parameter to start the service, but you need to manually create the folder.).
3. Open the CMD command line, enter the D:/DB/MongoDB/bin directory, and enter the following command to start the MongoDB service ,:
4. log on to MongoDB for simple operations.
(1) Start Mongo dB,
(2) execute insert and query,
5. Create the mongodbwindows service to enable the service automatically.
(1) create a service
Create the logs directory under the MongoDB installation directory, and then enter the following command in the CMD command line:
D: \ dB \ MongoDB \ bin> mongod -- logpath D: \ dB \ MongoDB \ logs \ MongoDB. log -- logappend
-- Dbpath D: \ dB \ MongoDB \ dB -- directoryperdb -- servicename MongoDB -- install
:
(2) start/stop the service
Net start MongoDB
Net stop MongoDB
(3) Delete a service
D: \ dB \ MongoDB \ bin \ mongod.exe -- remove