Articles → MONGODB → Dbpath And Logpath In Mongodb

Dbpath And Logpath In Mongodb






Purpose




db.serverCmdLineOpts()


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



How To Configure The Dbpath And Logpath?




  1. Create new paths for dbpath and logpath
  2. Open the command prompt in 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

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250