Installation and configuration of MongoDB under windows (1)

A Mongodb installation

Download mongodb

First log in to Mongodb official website to  download the   installation package, choose 32 or 64 bit according to your operating system

Install MongoDB

Install the downloaded installation package, similar to the installation of QQ and other software,

The middle is mainly to choose "Custom" to customize the installation path and modify it: D:\software\MongoDB

Then continue to "Next", the installation to the end.

 

Installation is relatively easy. The difficulty lies in starting the Mongodb service and setting MongoDB as a Windows service, and the configuration file can be found in the "Services" of Windows.

Create a storage location for database files

Create data under MongoDB, and then create db under data: D:\software\MongoDB\data\db

Because the database file storage folder must be created before starting the mongodb service, otherwise the command will not be created automatically, and it will not start successfully.

The use of MongoDB

1. Open the cmd command line

2. Enter the D:\software\MongoDB\bin directory (note: first enter d: to enter the d disk, then enter cd D:\software\MongoDB\bin)

3. Enter the following command to start the mongodb service: mongod --dbpath D:\software\MongoDB\data\db

 

Guess you like

Origin blog.csdn.net/Qianliwind/article/details/108724074