Quick Guide to Uninstall MongoDB from Windows

MongoDB is useful when we have started learning it to test our application locally, but as soon as we move to the cloud database, it becomes useless to have it installed in the system as it drains the battery and takes up unnecessary space in the memory. So it is better to uninstall it.

In this tutorial, you will see different methods to remove the MongoDB from a windows machine.

The different methods to remove MongoDB from windows are as follows:

  • Using Apps & Features Settings
  • Using Command Prompt
  • Using Registry Editor
  • Using Control Panel
  • Using .msi Installer

To uninstall MongoDB, it is necessary that it is installed, so let’s see how to check whether MongoDB is installed or not.

How to check if MongoDB is Installed on Windows?

Here are steps to check if you have MongoDB installed on a Windows machine:

  • Open File Explorer
  • Go to This PC from the left sidebar
  • Open C:/ drive
  • Look for the mongodb directory or, navigate to the file path you had originally installed MongoDB and look there for the mongodb directory, if the directory is present it means MongoDB is installed.

Also Read: Comprehensive Guide to Install and Set up MongoDB on Windows

How to Uninstall MongoDB from Apps & Features Settings?

Follow the below steps to remove MongoDB via the Apps & Features settings:

  • Click the start button and go to settings by clicking the gear icon
  • Click Apps
  • Under the Apps & features subheading, look for a search box and search for MongoDB
  • Click the MongoDB application
  • Lastly, click Uninstall
  • Check the file path where you have installed MongoDB. The mongodb directory should now be gone.
  • You might be prompted to restart your Windows machine. Even if not, it is still recommended that you do it.

How to Uninstall MongoDB from Command Prompt?

Follow the below steps to remove MongoDB using Command Prompt:

  • Go to Start and search for Command Prompt
  • Or, simply press the Win key+R to open Run. Type cmd and hit Ctrl+Shift+enter to run Command Prompt as administrator
  • Right-click on the result and select Run as administrator
  • Now, pass this command:
C:\>C:\MongoDB\bin\mongod.exe --config C:\MongoDB\mongod.conf --remove

Make sure the file path of the MongoDB directory is correct. If it is different from the above snippet, then search for the MongoDB directory in your system. Navigate into the path until you find both these paths. Copy the path from the path field and paste it and then modify it here accordingly.

  • After deleting, make sure you check mongodb directory in your system to see whether it is deleted or not.
  • You might be prompted to restart your Windows machine. Even if not, it is still recommended that you do it.

How to Uninstall MongoDB Using Registry Editor?

Follow the below steps to remove MongoDB using Registry Editor:

  • Open Start and search for Registry Editor and click the result. Or, simply press the Win key+R to open Run. Type regedit and hit enter.
  • You will be prompted by Windows saying “Do you want to allow this app to make changes?” Click Yes.
  • Now, in the path field on top, simply paste this path:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\MongoDB
  • Next, on the sidebar on the left, you should now be able to see the MongoDB directory.
  • Right-click on it and click delete.
  • Now, you will need to again check in the path where you originally installed MongoDB for the mongodb directory if it exists or not.
  • You might be prompted to restart your Windows machine. Even if not, it is still recommended that you do it.

How to Uninstall MongoDB Using Control Panel?

Follow the steps below to remove MongoDB using Control Panel in Windows 10:

  • Open Start and search for Control Panel. Click the result.
  • Or, simply press the Win key+R to open Run. Type control and hit enter.
  • Click Programs
  • Under the Programs and Features option, click Uninstall a Program
  • Look for MongoDB and right-click on it.
  • Now, click Uninstall
  • You will be prompted by Control Panel by saying “Are you sure you want to uninstall MongoDB…” Click Yes.
  • To ensure it is completely removed, check the path where you originally installed MongoDB for the mongodb directory to see if it exists.
  • You might be prompted to restart your Windows machine. Even if not, it is still recommended that you do it.

How to Uninstall MongoDB Using .msi Installer?

Follow the below steps to remove MongoDB using the .msi installer used for installing, repairing, and uninstalling MongoDB from Windows:

  • Open Start and search for .msi
  • Click the MongoDB .msi installer file
  • You should now see a MongoDB setup open for you, Click Next.
  • Click Remove
  • To ensure it is completely removed, check the path where you originally installed MongoDB for the mongodb directory to see if it exists.
  • You might be prompted to restart your Windows machine. Even if not, it is still recommended that you do it.

Read More: How to Connect MongoDB on Localhost 27017 in Windows

Conclusion

In this tutorial, we have provided an easy step-by-step guide on how to uninstall MongoDB from Windows. You can use any of the above-mentioned methods to uninstall as per your knowledge. The easiest way is to use the control panel, which does not require advanced technical knowledge. Hope you find this tutorial useful.

Reference

https://stackoverflow.com/questions/45497069/how-to-uninstall-mongodb-from-windows

Aneesha S
Aneesha S
Articles: 173