Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a batch file to repair and start corrupted mongoDB in windows?

I am unable to start my mongoDB after an unclean system shutdown. There is a mongod.lock with a size of 1 KB. I want to delete this file and then repair the mongoDB. I deleted the file and tried the command

mongod --dbpath "%ProgramData%\mongodb\data\db" --repair

But I am getting an error message...

I STORAGE [initandlisten] exception in initAndListen: 72 Requested option conflicts with current storage engine option for directoryPerDB; you requested false but the current server storage is already set to true and cannot be changed, terminating.....

Please assist...

like image 458
Nishad Azeez Avatar asked Jul 05 '16 10:07

Nishad Azeez


1 Answers

Try to add --directoryperDB like this:

mongod --dbpath "%ProgramData%\mongodb\data\db" --directoryPerDB
like image 147
Or Assayag Avatar answered Nov 05 '22 21:11

Or Assayag