mongodb: installation tutorial and problem solving

1. MongoDB database official website download address

  1. Download address: https://www.mongodb.com/try/download
    download the community version
    Insert picture description here
    Insert picture description here

2. Configure environment variables

Insert picture description here

3. Turn on the service

  1. Open cmd command window
  2. Enter the command mongod
  3. Enter the command mongo
    Insert picture description hereInsert picture description here

四.Error: Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), Connection refused

1. Data file
After MongoDB is installed, create a data folder in the MongoDB root directory, and then create a db folder in the data folder. An
error occurred when starting the service. Refer to the following blog post to solve the problem
Insert picture description here
. 2. Enter the command and
enter mongod in cmd .exe --dbpath D:\MongoDB\data
D:\MongoDB\data (representing the location where you want to store it, here is my location)
Open the cmd command again and enter mongo
Insert picture description here

Five. Reference

https://blog.csdn.net/muguli2008/article/details/80591256
https://blog.csdn.net/weixin_44422604/article/details/107009615
https://blog.csdn.net/weixin_45664911/article/details/106119748

Guess you like

Origin blog.csdn.net/weixin_42161670/article/details/114419496