- First download the MongoDB installation package on the official website: https://www.mongodb.org/downloads
Baidu Cloud Disk Download: http://pan.baidu.com/s/1slUSGYp (Installation version windows64 bit)
Note: Download the appropriate version according to your computer system
- After downloading the selection (custom or default installation), after installing the file:
- Select the Build folder in the D drive named Mongond
- Set up the data and log folder in the D-Disk Mongondb folder. Used to hold the file. Log is used for logging.
- After unpacking the entire bin to the D-Disk Mongondb folder
- Select System ----> Advanced system settings ----> environment Variables ----> set PATH variable:
Win7 you can right-click on the computer ---- Property After
Add a Path variable value:;D: \mongondb\bin ( Note : semicolon + path)
- There is no way to take effect immediately after setting the environment variable, so restart the computer.
- After the reboot is complete, create a new profile Mongodb.config in the Mongondb folder on the D drive: The contents are as follows:
# #数据文件
Dbpath=d:\mongondb\data
# #日志文件
Logpath=d:\mongondb\log\mongodb.log
# #错误日志采用追加模式, after configuring this option, the MongoDB log is appended to the existing log file instead of creating a new file
Logappend=true
#启用日志文件, enabled by default
Journal=true
#这个选项可以过滤掉一些无用的日志信息, set to False if you need to use Debug
Quiet=true
#端口号 defaults to 27017
port=27017
- Open the cmd command line, run the above configuration file, after the run is complete, open the browser: http://127.0.0.1:27017/
- Open the Run command to test the MONGONDB run state, enter the command representation in the diagram: Display the database
- at this point, the successful operation of the mongodb, because every time such a routine startup is troublesome, how to solve this problem in order to facilitate the start-up convenience, the following introduction will be mongodb as windows service started.
Commands are as follows:
Mongod--config d:\mongoDB\mongo.config--install
SC Way:
The command is as follows:
SC Create MongoDB binpath= "D:\mongoDB\bin\mongod.exe--service--config=d:\mongodb\mongo.config"
Note: May be in win7 , win8 cannot be installed in the usual manner Please use SC mode
picture with SC mode watch for c:\windows\system32\cmd.exe
under Run as Administrator " .
- At this point the MongoDB installation is complete. You can enter the command line services.msc to run the view .
There's time to be quiet listen to the song write code, design a project, from beginning to end a project to develop a summary is also good.
Organize some articles, nothing to write something, share some practical cool text.
Public number "Information cool", no dream why far away, interested in children's boots can pay attention to see.
MongoDB installation and configuration scenarios under Windows