installation files: Mongodb-win32-x86_64-2008plus-ssl-3.2.6-signed.msi
PC configuration: Win7 64-bit
MongoDB installation is very simple, set up the installation path, always next until the end of the installation, the largest pit is the installation of MongoDB service, the following specific after the MongoDB installation of some configuration operations
The "claim" My installation path is: D:\Program files\mongodb\server\3.2
1. Create the database path (data directory), log path (logs directory), and log file (Mongo.log file), as shown in
2. Create the configuration file mongo.conf, the file contents are as follows:
- Dbpath=d:\program Files\mongodb\server\3.2\data #数据库路径
- Logpath=d:\program Files\mongodb\server\3.2\logs\mongo.log #日志输出文件路径
- Logappend=true #错误日志采用追加模式
- Journal=true #启用日志文件, enabled by default
- Quiet=true #这个选项可以过滤掉一些无用的日志信息, set to False if you need to use Debug
- port=27017 #端口号 defaults to 27017
3. Start MongoDB
After the first two steps are completed, you can start MongoDB, first enter the D:\Program files\mongodb\server\3.2\bin (depending on the installation directory) directory, the Start command is as follows:
- Mongod--config "D:\Program files\mongodb\server\3.2\mongo.conf"
After the command executes, enter http://127.0.0.1:27017 in the browser to see the following interface that indicates the success of the launch
4. Create and start the MongoDB service
If every time you follow step three, it would be quite a hassle to create and start the MongoDB service by following the command below, you can manage the startup and shutdown of MongoDB through the Windows service
First enter the D:\Program files\mongodb\server\3.2\bin (depending on the installation directory) directory, the Start command is as follows:
- Mongod--config "D:\Program files\mongodb\server\3.2\mongo.conf"--install--servicename "MongoDB"
- net start MongoDB
If you need to uninstall MongoDB service, first enter D:\Program Files\mongodb\server\3.2\bin (depending on the installation directory) directory, execute the following command:
- Mongod.exe--remove--servicename "MongoDB"
At this point, all operations have been completed and the service has been successfully installed.
PostScript: The initial installation of the service is installed with SC, the command is as follows:
- SC create MongoDB binpath= "D:\Program files\mongodb\server\3.2\bin\mongod.exe--service--config=d:\program Files\ Mongodb\server\3.2\mongo.conf "
After execution can create the service, but unable to start the MongoDB service, each boot will prompt 1053 error, based on the search solution to try the following command or not resolved
- Mongod.exe--bind_ip 127.0.0.1--logpath "D:\Program files\mongodb\server\3.2\logs\mongo.log"--logappend--dbpath "D : \program Files\mongodb\server\3.2\data "--directoryperdb--servicename MongoDB--install
from:http://blog.csdn.net/mzbonnt/article/details/51461331
Windows installation MONGODB2