MongoDB download, install, configure, start

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allow https://blog.csdn.net/g_optimistic/article/details/90201243

table of Contents

1. Download

2. Install

3. Create a database file storage location

4. Specify db directory and start

5. In the browser, see if the database connection is successful

6. Configure the local service windows mongodb

7. Configure windows service

8. Start the MongoDB service


1. Download

Software Download: http: //dl.mongodb.org/dl/win32/x86_64
select the corresponding version, then download. Note: mongodb3.6 version at the time of installation will be stuck not move, recommended large
home can install version 3.4

Download completed:


2. Install

The installation process is relatively simple, has been the next point, but note that you want to modify the installation path

Modify the installation path

start installation

Successful installation


3. Create a database file storage location

In the 3.4 folder, the new data folder, the new data in the db file folder and log folder


4. Specify db directory and start

In the command line window, enter the first bin path,

Then enter the command:

mongod --dbpath D:\MongoDB\Server\3.4\data\db

In this case, the database launched


5. In the browser, see if the database connection is successful

Enter your browser to http: // localhost: 27017 (27017 is mongodb port number) to see if the show:

Said that a successful connection. If unsuccessful, you can see if the port is occupied.
Of course, we can open a new window for a database operation command, as shown in FIG. (Note: The current start
Database window move do not close)


6. Configure the local service windows mongodb

Written mongo.config file:

dbpath=D:\MongoDB\server\3.4\data\db
logpath=D:\MongoDB\server\3.4\data\log\mongo.log


7. Configure windows service

Note: cmd to open a command window as an administrator

cmd to jump to D: \ MongoDB \ Server 3.4 under \ \ bin directory. Input:

mongod --config "D:\MongoDB\Server\3.4\mongo.config" --install --serviceName "MongoDB" 

That is according to mongo.config configuration file you just created installation services, to name MongoDB.


8. Start the MongoDB service

Computer -> Management ---> Services to Applications ---> Services -> MongoDB -> Start

Guess you like

Origin blog.csdn.net/g_optimistic/article/details/90201243