Windows system installation runs Mongodb service

  • 2020-12-07 04:34:40
  • OfStack

download & The installation

Download from the website https: / / www mongodb. com/download - center # community

Add MongoDB to the system path

My computer > Property - > Change Settings - > Advanced - > Environment variable - > path Add C:\Program Files\ Server\ Server\3.6\bin to path your installation path

Register MongoDB as one of Windows's services

Create configuration file

I created the file mongod.cfg under the directory C:\myconfig\monogodb\ with the contents mongod.cfg


systemLog:
  destination: file
  path: D:\MonogoDB\log\mongod.log
storage:
  dbPath: D:\MonogoDB\db
D:\MonogoDB\log\ mongod.log: Log address D:\MonogoDB\db: Database storage location

Run cmd as an administrator


mongod "mongod --config "C:\myconfig\monogodb\mongod.cfg" --serviceName "MongoDB" --serviceDisplayName "MongoDB" --install

This is successful, and you will find that there are more "MongoDB" services available locally. And we're done.

Can be through: "boot from the boot, can directly start and shut down manually".

After opening, you can connect normally. You can use pycharm or IDE to connect,

pycharm connects to mongodb. You can configure the mongo plug-in connection using pycharm.

Start the & stop & Remove the service

net start MongoDB # start net stop MongoDB # closed mongod --remove # deleted

conclusion


Related articles: