How to repair MongoDB using command prompt in windows

repair mongodb using command prompt

Sometimes the Mongo database starts showing error when your system accidentally gets shut down. Here I will explain way to repair MongoDB database using Command Prompt in Windows.

Step 1:

Go to C directory and create a folder on root named data.


Step 2:

Press Windows + R to open Run and type cmd and click OK button.


Step 2:

Change directory to root using command


Step 3:

Type the Full Path of mongod.exe service. Check your installation directory of MongoDB. In my case, the installed directory is Program Files (x86)

Notice the parameter –repair is added in the command.


Step 4:

Hit Enter key and wait for it to finish.

Your Mongo database is now repaired



Learn how to start MongoDB in Windows.

Thanks for reading.

Leave a Reply

Your email address will not be published. Required fields are marked *