Articles → MONGODB → Dbpath And Logpath In Mongodb

Dbpath And Logpath In Mongodb



Picture showing the output of db.serverCmdLineOpts() command that shows the dbpath and logpath
Click to Enlarge

How To Configure The Dbpath And Logpath?

  1. Create a new path for dbpath and the logpath
  2. Open the command prompt in the admin mode
  3. Go to the path of mongod (C:\Program Files\MongoDB\Server\6.0\bin in my case)
  4. Execute the following command
  5. C:\Program Files\MongoDB\Server\6.0\bin>mongod --dbpath "C:\\Program Files\\MongoDB\\Server\\6.0\\custom\\data" --logpath "C:\\Program Files\\MongoDB\\Server\\6.0\\custom\\log\\mongod.log"

Posted By  -  Karan Gupta
Posted On  -  Tuesday, August 29, 2023


Your Email Id  
Query/FeedbackCharacters remaining 250