Original address: http://blog.csdn.net/polo_longsan/article/details/52430539
1. Download the installation file for MongoDB under Windows
First go to the official website https://www.mongodb.com/download-center?jmp=nav#community download the installation files. Mongodb-win32-x86_64-2008plus-ssl-3.2.9-signed.msi. Double and install, select the installation path.
2, then in the directory under the new Data folder, F:\mongodb\data;logs folder, f:\mongodb\logs;conf folder, F:\mongodb\conf. They are used to store data, logs, and configuration files, respectively.
Under the Conf folder, create a new Mongodb.config file with the following contents:
Dbpath=f:\mongodb\data #数据库路径
Logpath=f:\mongodb\logs\mongodb.log #日志输出文件路径
Logappend=true #错误日志采用追加模式, after configuring this option, the MongoDB log is appended to the existing log file instead of creating a new file
Journal=true #启用日志文件, enabled by default
Quiet=true #这个选项可以过滤掉一些无用的日志信息, set to False if you need to use Debug
port=27017 #端口号 defaults to 27017
Under the Logs folder, create a new Mongodb.log file.
3, open the MongoDB service, start the DOS command window as an administrator, start the MongoDB service, you can see the MongoDB service in the service, the next time directly execute the bin directory of the Mongo.exe client can be operated.
[HTML]View PlainCopy
- F:\mongodb\bin>mongod.exe--config F:\mongodb\conf\mongodb.config--install--servicename "MongoDB"
- F:\mongodb\bin>net Start MongoDB
- The MongoDB service is starting.
- MongoDB Service has started successfully.
- F:\mongodb\bin>
4, Start MongoDB client Mongo.exe, insert a piece of data and query it out.
MongoDB installation under Win10