Install and Start MongoDB under Windows

1. Download

Official documentation:
https://www.mongodb.com/docs/manual/installation

You can visit the download center:
https://www.mongodb.com/try/download/community

Choose zip.

2. Start

2.1 Use the command directly

In the bin directory of the same level,
create directory /data/db.

Enter the following command in the command window under the bin directory:

1
mongod --dbpath=../data/db

2.2 Start with configuration file

In the bin directory of the same level,
create directory /config,
create file mongod.conf under this directly.

1
2
storage:
dbPath: D:\DBServer\mongodb-win32-x86_64-windows-6.0.0\data\db

Start method:

1
2
3
mongod -f ../config/mongod.conf
or
mongod --config ../config/mongod.conf

Install and Start MongoDB under Windows
https://www.hardyhu.cn/2022/08/03/Install-and-Start-MongoDB-under-Windows/
Author
John Doe
Posted on
August 3, 2022
Licensed under