0

I was getting this error when I was trying to change my dbpath

mongod --dbpath "C:\Program Files\MongoDB\Server\4.2\db"
Bikki Mahato
  • 136
  • 1
  • 9
  • check this out [stackoverflow](https://stackoverflow.com/a/42447303/11089768) and if you are on windows check this [stackoverflow](https://stackoverflow.com/a/59432890/11089768) – Adewale Olaoye Dec 21 '19 at 01:35

1 Answers1

4

I fixed it in 2 ways:

First, using cmd as an administrator then it worked

Second, changing my drive to some other drive.

mongod --dbpath "D:\MongoDB Self\db"

If you have any other solutions please let me know.

Bikki Mahato
  • 136
  • 1
  • 9