1. Download MongoDB
Download MongoDB version of Windows, there are 32-bit and 64-bit editions, download according to system conditions: http://www.mongodb.org/downloads
2. Installing MongoDB
Install to D:\Program files\
3. Database file directory
Specifies where the database file is stored D:\mongodb\data\db
You must create a storage folder for the database files before you start the MongoDB service, otherwise the command will not be created automatically and cannot start successfully. The default folder path is C: \data\db, and when you use the System default folder path, the startup service does not need to add--dbpath parameter descriptions, but folders are also created manually.
4. Set the database file path
Open the cmd command line, enter the D:\Program files\mongodb 2.6 standard\bin directory, enter the following command to start the MongoDB service:
Mongod.exe--dbpath D:\mongodb\data\db
Indicates a successful start, the last two lines of the database port and the Web port, the default is 27017 and 28017, in the browser open http://localhost:28017, you can see some information about it.
5. Resetting the database port
You can modify the database port by adding the parameter--port:
D:\Program files\mongodb 2.6 standard\bin>mongod.exe--port 10001--dbpath D:\mongodb\data\db
6. Test MongoDB
by double-clicking Mongo.exe in the Bin directory of the MONGDB installation directory, you can perform MONGODB client command operations.
7. MongoDB is set to Windows service
Every time you start MongoDB is inconvenient, you can use it as a Windows service, so it is much easier.
To install MongoDB Windows services by creating the logs directory under the MongoDB installation directory, and then the cmd command line into the bin directory of the MongoDB installation directory, enter the command:
Mongod--logpath d:\ Program Files\mongodb 2.6 standard\logs\mongodb.log--logappend--dbpath D:\ Mongodb\data\db --directoryperdb--servicename MongoDB--install