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. : Www. mongodb
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
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. : Here 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. When the System 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