Home  >  Article  >  Java  >  How to build a SpringBoot integrated MongoDB environment

How to build a SpringBoot integrated MongoDB environment

王林
王林forward
2023-06-02 20:15:551274browse

Download MongoDBHow to build a SpringBoot integrated MongoDB environment

Create a directory under the D drive
In D:\MongoDB\Data
Extract the downloaded installation file in the D:\MongoDB directory
How to build a SpringBoot integrated MongoDB environment

win R open the CMD window
Enter the bin directory (mine is D:\MongoDB\mongodb-win32-x86_64-2008plus-ssl-4.0.3\bin)
Start MongoDB input: mongod.exe --dbpath=D:\MongoDB\Data
After success, the default database port of MongoDB connected to 27017 is displayed
How to build a SpringBoot integrated MongoDB environment

Configure MongoDB environment variables
I Right-click the computer properties, select Advanced System Settings
How to build a SpringBoot integrated MongoDB environment

Click on Environment Variables
How to build a SpringBoot integrated MongoDB environment

Select PATH and click Edit
How to build a SpringBoot integrated MongoDB environment

Create a new bin directory path after decompression of MongoDB (mine is D:\MongoDB\mongodb-win32-x86_64-2008plus-ssl-4.0.3\bin)
How to build a SpringBoot integrated MongoDB environment

##CMD Enter mogod -help in the window and the following figure shows that the configuration is successful


How to build a SpringBoot integrated MongoDB environment

Write a script to start MongoDB

Create a new mongodb.bat file

How to build a SpringBoot integrated MongoDB environment

Write the file content

mongod --dbpath=D:\MongoDB\Data

How to build a SpringBoot integrated MongoDB environment

Enter the CMD window again and enter mongodb to display the following picture. Successful startup


How to build a SpringBoot integrated MongoDB environment

The above is the detailed content of How to build a SpringBoot integrated MongoDB environment. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete