- Install MongoDB. : Http://www.mongodb.org/downloads
- Select the MSI file or ZIP package, install it in your own directory, I installed the F:\mongodb
- Create Folders f:\mongodb\data\db, F:\mongodb\data\log, respectively, to install the DB and log files, create a log file under the log folder MongoDB.log, that is, f:\mongodb\data\log\ MongoDB.log
- Run cmd.exe into the command line window and execute the command:
>CD F:\mongodb\bin
>f:\mongodb\bin>mongond-dbpath "F:\mongodb\data\db"
If you see waiting for connections on port 27017, it indicates that the service started successfully.
- Test connection
Open a new CMD window and enter the command:
>CD F:\mongodb\bin
>f:\mongodb\bin>mongo
If you see a similar window, the test is successful.
- Making a startup item
First explain the Mongod.exe and Mongo.exe, in the MongoDB Bin folder there are two EXE programs, respectively, the server and the client. You can run Mongo.exe only if you start Mongob.exe first.
To avoid entering Mongond-dbpath "f:\mongodb\data\db" in cmd, you can make a startup bat file. Method: Create a new mongod.txt file, rename it to Mongod.bat, open it with the editor, enter it in
Save, so that every time you double-click the Mongod.bat file, the MongoDB service is started.
MongoDB installation and start-up