Before installing MongoDB, first download MongoDB Software installation package, MongoDB Community Edition official website: https://www.mongodb.com/download-center?jmp=nav#community
After downloading, double-click the MSI installation file to install, click "Next" >>
Tick agree to the relevant agreement, click "Next" >>
Click "Custom"--"Browse" for custom directory installation, recommended to install in C:\MongoDB, click "Next" >>
Uncheck Install "Installed MongoDB Compass" (otherwise there will be no progress on the install Compass interface, causing the installation to fail), click "Next" >>
Click "Install" for installation >>
If the following interface appears, then congratulations, the installation was successful.
MongoDB installation difficulty is not the installation process, difficult to install MongoDB service, the following describes the installation of MongoDB services
Before installing the MongoDB service, create two folders in the MongoDB installation directory (C:\MongoDB), one for the Data folder (to store the database files), and the other for the log folder (to store the journal files)
Create a DB folder under the Data folder
Create a Mongo.log file under the log folder
Run cmd as Administrator, switch to the MongoDB installation directory Bin folder
Execute the following instructions to install the MongoDB boot service
C:\mongodb\bin>mongod.exe--dbpath c:\MongoDB\data\db--logpath=c:\mongodb\log\mongo.log--logappend--install-- ServiceName "MongoDB"
Do not hit the wrong female, enter, press ENTER to install
。。。 Installation error, sad after a minute online to find the reason
Originally MongoDB was developed in C + +, to run MongoDB, you must install the Visual C + + redistributable Package
Official website: https://www.microsoft.com/zh-CN/download/details.aspx?id=48145
If installing the Visual C + + redistributable package fails, make sure that the operating system has SP1 patches,
SP1 Patch for: https://www.microsoft.com/zh-cn/download/confirmation.aspx?id=5842
Install the Visual C + + redistributable package, and then install the MongoDB boot service, found this time no error, is not slightly excited
Start the MongoDB service with the following command
C:\mongodb\bin>net Start MongoDB
Or find a MongoDB service inside the service to start
After you start the MongoDB service, you can connect to the MongoDB database for operation.
You can add the MongoDB directory (c:\MongoDB\bin) to the environment variable, so that you can use the MongoDB command-line tool in any location
MongoDB Base MongoDB Installation