First of all, download and install mongodb, I won't talk about the specific download and installation tutorial, the version I use is "mongodb-win32-x86_64-2008plus-ssl-3.4.7-signed"
The directory I installed was: D:\MongoDB\Server\3.4\
I started MongoDB in the form of a configuration file and created a new mongo.conf file by myself
<setting> = <value> This configuration format is the configuration file of MongoDB version 2.4, and the new version can be compatible with the configuration commands of the old version
Official website introduction link: https://docs.mongodb.com/v2.4/reference/configuration-options/
The new version is based on the YAML profile format, and the introduction link: https://docs.mongodb.com/manual/reference/configuration-options/
The configuration is as follows:
Then enter the bin directory and start it with the cmd command, the startup command is as follows:
The error is as follows:
--------------------------- mongod.exe - System error --------------------------- This program cannot be launched because api-ms-win-crt-runtime-l1-1-0.dll is missing from the computer. Try reinstalling the program to fix this issue. --------------------------- Are you sure ---------------------------
Here's how to fix it:
Installing VC redit.exe program to solve
It is a program of VC: VC redit.exe Link: https://www.microsoft.com/zh-cn/download/details.aspx?id=48145
Choose x86 or x64 when downloading according to the needs of your system, and the installation is successful.
After this problem is solved, we re-run the startup command and find that the new error is as follows:
D:\MongoDB\Server\3.4\bin>mongod --config "D:\MongoDB\Server\3.4\mongo.conf" 2017-08-20T15:40:48.459+0800 F CONTROL [main] Failed global initialization: Fil
eNotOpen: Failed to open "D:\MongoDB\Server\3.4\logs\mongo.log" Solution: Create a new logs folder under the D:\MongoDB\Server\3.4\ directory!!!
Then, execute the startup command again, and find that there is no error this time, but the port is not connected, the startup is not successful, and the error is not reported, as follows:
In fact, this is not a successful start, and the solution is as follows:
Under the D:\MongoDB\Server\3.4\directory, create a new data folder!!!
BecauseIn the configuration file, we specify the directory of the two files, the program will not automatically create the directory, you need to create it manually, if the directory does not exist, MongoDB will fail to start! Errors may not be reported!!!
All, logs and data directories need to be created manually, this time the start is successful!!!
After successful startup, do not close the cmd window, if you close the cmd window, MongoDB will also be closed!!!
The MongoDB startup success interface is as follows:
|