mongod and mongo commands not working on windows 10

后端 未结 6 1269
灰色年华
灰色年华 2021-02-13 22:27

I\'ve installed mongoDB on my windows 10 OS. Then I tried setting its database path to some directory by moving to it and typing mongod --datapath=data in cmd, wher

6条回答
  •  北恋
    北恋 (楼主)
    2021-02-13 22:51

    Same problem here. I installed through the .msi file provided for windows X64bit. In the installer instructions from MongoDB (https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/), I read that you can add C:\Program Files\MongoDB\Server\4.2\bin to the System Path. Then it asks to omit the full path to the the MongoDB binaries. That is where I think some information is missing. How are we supposed to omit the full path to the MongoDB binaries?

    Currently I can get MongoDB to run mongod using:

    "C:\Program Files\MongoDB\Server\4.2\bin\mongod.exe" --dbpath="c:\data\db"

    For --dbpath="c:\data\db" you can replace "c:\data\db" with the path to your database.

    I can also run mongo using:

    "C:\Program Files\MongoDB\Server\4.2\bin\mongo.exe"

提交回复
热议问题