Windows installation MongoDB
First go to the official website (https://www.mongodb.com/download-center?jmp=nav#community) and download a MongoDB Windows client.
I downloaded two versions of the 3.4.11 version, one is 3.6.2.
Originally used MongoDB with Springboot learning, so first choose the latest version, but the installation of stuck, stuck in the compass
Workaround:
1. Wait half an hour, or longer. (http://blog.csdn.net/only_yu_yy/article/details/78884834)
1. When installing the custom installation, the installation is to cancel the install MONGO Compass (in the lower left corner).
2. Do not install 3.6, install 3.4.
Installed a 3.4
Windows configuration MongoDB
Configure environment variables.
1.path Add:
D:\software\mongodb\Server\3.4\ Bin
(See the address you installed)
2. Create a two folder
E:\mongodb\data
E:\mongodb\data\logs
3. Create a service
CD D:\software\mongodb\Server\3.4\ Bin
(Remember to CD to this path to execute the next statement, otherwise the following steps will be error)
Mongod--dbpath=e:\mongodb\data--logpath=e:\mongodb\logs\mongodb.log--install "MongoDB " --logappend--directoryperdb
4. Start the service
net start MongoDB
5. Visit http://localhost:27017 the following appears.
- If the following conditions occur (2018-02-06t21:20:47.814+0800 F CONTROL [main] Failed global initialization:FileNotOpen:Failed to open "E:\mong Odb\logs\mongodb.log ")
No folder created, or create a problem, return to step 2
System error 5 occurs if the following conditions occur (net start MongoDB). Access denied. )
To run CMD as an administrator, execute this command.
System error 2 occurs if the following condition occurs (>net start MongoDB). The system cannot find the file specified. . )
is not executed under an absolute path, or it may be a dirty unload
Mongod--dbpath=e:\mongodb\data--logpath=e:\mongodb\logs\mongodb.log--install "MongoDB " --logappend--directoryperdb
Needs to be deleted first
" MongoDB "
Then go back to step 3 and re-execute.
Finally, it's OK.
Windows installation MongoDB progress bar stuck, window installed MONGO system error 2, system error 5 workaround