Preface
Author: Chenyun Zhi
I just write blog in csdn
MongoDB database installation and configuration environment
1. Download and installation of MongoDB
1.1 Download URL
https://www.mongodb.com/download-center/community?jmp=docs
1.2 Installation
Create a mongodb folder to store the downloaded zip
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 !
Enter the command to view the version of mongoDB
mongo -version
3. Configure system services
- Create a data folder and a log folder in the MongoDB decompression directory (under the same level as the bin file)
- Created in the data folder db folder used to store database data
- Create a log directory under mongodb.log file used to store log
- Create a new file mongo.config and open it with Notepad and
mongo.config
enter the following:
dbpath=D:\mongodb\data\db
logpath=D:\mongodb\data\log\mongodb.log
- Open the cmd command box as an administrator (start-type cmd to find cmd.exe-right-click-run as an administrator)
- 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)
- Click
windows+r
, enterservices.msc
, or right-click the computer-system service, open the win10 service box
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!
- Enter net start mongoDB in cmd to start the service
- Enter mongo in the bin directory in cmd to connect to the mongodb service
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