Mongodb installed on windows

Brief introduction

In the reptile work, we often need to store data in non-relational databases, MongoDB is a non-relational databases, MongoDB is a multi-platform database, the next day I will record my installation time data in the windows recording;

Using the installation package: mongodb-win32-x86_64-2008plus-ssl-3.4.10-signed.msi

We can directly download here: Baidu Cloud: https://pan.baidu.com/s/1c-um10DOoi9uq5eKLncwxA Password: 04rv

MongoDB can also go to the official website and download the PC under the circumstances specified version of the software

start installation

1, open the installer, click next

Click next to open software

2, check the agreement, click next

Check agreement, click next

3, select Custom

Select Custom

4, select the path and click next

The new path is set in; C: \ MongoDB \ Server \ 3.4 \

Set Path

5. Click Install

Click Install

6, into the installation process, and so end

Installation process

Installation is complete

Begin configuring

Do not think you can use the installation finished ..........

1. Create a folder

Creating \ MongoDB \ under Server \ 3.4 directory data folder, create a folder db in the data folder, creating the logs folder in the data folder, create mongo.log file (this file in the logs folder: C mongo.txt can create a file and then change the suffix name to log)

Folder structure

Do not forget to create mongo.log file in the logs folder

complete

2. Add the environment variable

MongoDB join the environmental variables C: \ MongoDB \ Server \ 3.4 \ bin

Then open cmd input mongo --help to join a large number of echo expressed successful

Adding an environment variable success

3, the configuration data path and log path

The following were the following two sentences run in cmd

Specify the database path: mongod --dbpath C: \ MongoDB \ Server \ 3.4 \ data \ db

Specify the database path

The second sentence added to the system command and specify the service log path: mongod --bind_ip 0.0.0.0 --logpath C: \ MongoDB \ Server \ 3.4 \ data \ logs \ mongo.log --logappend --dbpath C: \ MongoDB \ Server \ 3.4 \ data \ db --port 27017 --serviceName "MongoDB" --serviceDisplayName "MongoDB" --install

This sentence does not wrap must pay attention

Added to the system server

End Configuration

In fact, this step is finished, but now mongodb or manually open each time you use MongoDB need to use the command in cmd input

net start MongoDB start mongodb

net restart MongoDB restart

net stop MongoDB Close

It does not meet my habits from the start I like ....................................

Right-click on My Computer or computer system services to open, select mongodb, set up from the start

 

Guess you like

Origin www.cnblogs.com/bihaiba/p/11229417.html