preface

Online read a few MongoDB installation articles, roughly the same, some two very detailed did not record, only recorded the Baidu experience “Windows below the installation and use of MongoDB”, download the installation of the entrance to find a long time…..

Therefore, I want to compile the latest steps of mongdb installation. The specific steps are as follows:

Step1 download from the official website

  • Go to the MongoDB website: www.mongodb.com/

  • Click “Community Server” as shown:

  • Go to “Community Server”, as shown in the picture, and click “Download”

Step2 installation

When it’s downloaded, it looks like this.

  • Double click on the install

  • Default installation (optional installation address), all the way to next.

Note: Copy out the installation path, which may be used to configure the global variable environment later

At this point, the installation is complete, the desktop will be an additional icon.

This is a visualization tool for MongoDB that comes with the default installation, no additional installation is required. The following interface will appear when you open the app:

Start MongoDB as an administrator (problems described below)

net stop MongoDB
Copy the code
  • Click “Connect” to Connect to the database, as shown in the picture below. (Because I don’t want to delete the library, so this graph has data, hahaha)

There is also a command line link later in “Problems encountered”.

Global variable problem

Verify that the configuration is successful

mongod --version
Copy the code

Unsuccessful ????

No: environment variables are not configured. This is where the previously copied installation path comes in handy.

My installation path is: D:\MyMongoDB\

Complete to the bin file: D:\MyMongoDB\bin

Configure global environment variables

Click on environment variables

With Path selected, click Edit (set to global user variable or system variable)

Click “New” to add the global variable environment

Fill in the address of the previous MongoDB startup file. Click OK all the way

Open a new command window and re-enter the command as shown below

Command connection database problem

Start the mongo

Net start MongoDB // System error 5 // Indicates that the current user does not have the permission to open CMDCopy the code

Run as an administrator

And then, there you go!

Other commands

Stop the mongo

net stop MongoDB
Copy the code

Delete the mongo

I haven’t tried this, but if you’re curious, you can try it. Ha ha ha ha

sc delete MongoDB
Copy the code

Because I do not understand the command line database, also do not operate, so I can only introduce here.

Still think visualization tool is more fragrant ~