2021 latest version of MongoDB database installation and configuration environment (windows10 system)

Preface

Author: Chenyun Zhi
I just write blog in csdn

1. Download and installation of MongoDB

1.1 Download URL

https://www.mongodb.com/download-center/community?jmp=docs
Insert picture description here

1.2 Installation

Create a mongodb folder to store the downloaded zip
Insert picture description here

2. Configure the environment

Right-click and select Computer->Properties

As shown in the figure below, we enter the path of the bin folder of MongoDB installed by ourselves in the new creation and select OK !

Insert picture description here

Insert picture description here

Enter the command to view the version of mongoDB

mongo -version

Insert picture description here

3. Configure system services

  1. Create a data folder and a log folder in the MongoDB decompression directory (under the same level as the bin file)
  2. Created in the data folder db folder used to store database data
  3. Create a log directory under mongodb.log file used to store log

Insert picture description here
Insert picture description here

  1. Create a new file mongo.config and open it with Notepad and mongo.configenter the following:
dbpath=D:\mongodb\data\db  
logpath=D:\mongodb\data\log\mongodb.log

Insert picture description here

  1. Open the cmd command box as an administrator (start-type cmd to find cmd.exe-right-click-run as an administrator)
  2. Enter the bin folder and enter the following command
mongod --config F:\study\mongodb\mongodb-win32-x86_64-windows-4.4.4-rc1\mongo.config --install --serviceName "MongoDB" --journal  

Note: The following figure is the path to enter my storage configuration file (for reference only)

Insert picture description here

  1. Click windows+r, enter services.msc, or right-click the computer-system service, open the win10 service box

Insert picture description here

You will see MongoDB in the local service list, indicating that mongodb has been successfully added to the system service, but the service has not been started yet!

Insert picture description here

  1. Enter net start mongoDB in cmd to start the service

Insert picture description here

  1. Enter mongo in the bin directory in cmd to connect to the mongodb service

Insert picture description here

My blog: https://blog.csdn.net/weixin_46654114
I want to pay attention to my b site: https://space.bilibili.com/391105864
Reprint instructions: Tell me, be sure to indicate the source, and attach my blog link.

Please give me a thumbs up and encourage me
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_46654114/article/details/113839019
Recommended