1. Download suitable mongodb
Official Website: http://www.mongodb.org/downloads
MongoDB for Windows has three versions:
- MongoDB for Windows Server 2008 R2 only runs on Windows Server 2008 R2, Windows 7 64-bit, and updated Windows versions. This version makes full use of new Windows enhancements and cannot run on earlier Windows versions.
- MongoDB for Windows 64-bit only runs in Windows XP and later 64-bit Windows versions, including Windows Server 2008 R2 and Windows 7 64-bit.
- MongoDB for Windows 32-bit can run on any 32-bit Windows version above Windows XP. The 32-bit version of MongoDB is only applicable to old systems and system applications for testing and development.
I downloaded the latest version 2.2.0. During installation, the system reported the error "unable to locate the program Input Point InterlockedCompareExchange64 at mongodb startup. You can only view the documentation. version 2.2.0 does not support Windows XP (Changed in version 2.2: MongoDB does not support Windows XP. please use a more recent version of Windows to use more recent releases of MongoDB .), download the old version again.
2. Unzip the installation package to the appropriate path.
Decompress the installation package to the path D: \ data \ mongodb.
3. Create a data folder
Create a data file D: \ data \ db
4. Start Mongodb
Run the following command:
D:\data\mongodb\bin\mongod.exe --dbpath D:\data\db
If the path contains spaces, double quotation marks are used to enclose the entire path. For example:
D:\data\mongodb\bin\mongod.exe --dbpath "D:\data\db test"
5.MongoDB sets the log directoryMongoDB as a Windows Service