How to uninstall mongodb from Windows
Since you're using Windows, just run the same .msi
file that you installed it with.
It should be in your downloads folder, i'm guessing.
Once you opened the file, press next and there you will have the complete access to remove your MongoDB installation.
Use the command below to delete the service:
- run cmd as Administrator
sc delete MongoDB
The command...
C:\MongoDB\bin\mongod.exe --config C:\MongoDB\mongod.conf --remove
Is used to just remove the service.
If you don't have a mongod.conf
and/or no longer have the .msi
installer (who keeps that stuff?) then:
- win-key + r and run regedit
- Navigate to
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MongoDB
(or just cut and paste this path) - Once there right click on MongoDb and click Delete. Service is now gone.
- Goto C:\mongodb (or where you installed it) and delete directory. Mongodb is now gone.
Check your system environment variables to see if it's in your path (It will not exist unless you put it there).
Alternatively you may be able to re-download the msi and try using that.
EDIT: If you forgot to stop the service first or if it left dead orphan in services then open CMD or other shell as administrator and run the command: sc.exe delete MongoDB ... you should see: [SC] DeleteService SUCCESS