MongoDB is a non-relational database (NOSQL) that is currently very popular in the IT industry, and its flexible data storage methods are favored by current it practitioners. Here's how to install MongoDB under the Windows platform.
Tools/Materials
- Mongodb-win32-x86_64-2008plus-2.6.7.zip
Method/Step
Login to MongoDB official dot click on the right side of the download
Select the Windows platform and click on the zip file you need to download (I am here to install the main complaint zip file)
The legacy version can be used for installation under older versions of the system and is not recommended here.
Unzip the zip file into the root directory of the drive letter (for example, C: or D:), in order to facilitate the suggestion folder naming as short as possible (D:\MONGODB)
Create a storage location for the database file, such as d:/mongodb/data/db. You must create a storage folder for the database files before you start the MongoDB service, otherwise the command will not be created automatically and cannot start successfully.
Open cmd (Windows key +r input cmd) command line, enter the D:\mongodb\bin directory (first enter D: Enter D and then enter the CD D:\mongodb\bin),
Enter the following command to start the MongoDB service:
D:/mongodb/bin>mongod--dbpath D:\mongodb\data\db
MongoDB Default connection port 27017, if so, can open http://localhost:27017 view (the author here is Chrome), found that the connection is successful, if not successful, you can see whether the port is occupied.
In fact, MongoDB can be set to Windows services, this operation is for convenience, each time the boot MongoDB automatically started.
Create a new folder log (log file) under D:\mongodb\data and create a new file Mongodb.log
Create a new file in D:\mongodb Mongo.config
Open Mongo.config input with Notepad:
Dbpath=d:\mongodb\data\db
Logpath=d:\mongodb\log\mongo.log
Open the cmd command line as an administrator , enter the D:\mongodb\bin directory, and enter the following command:
D:\mongodb\bin>mongod--config D:\mongodb\mongo.config
The results are stored in the log file, and viewing the log discovery has been successful. If it fails, it is possible that access is denied without administrator status.
Open cmd Input services.msc view service can see MongoDB service, click can launch.
Installation and configuration of MongoDB under Windows