Reputation: 948
I saw a tutorial that said to run this:
C:\mongodb\bin\mongod.exe --config C:\mongodb\mongod.conf --remove
but that command does not work since there is no mongod.conf
file in the mongodb folder in my Windows. Besides, I don't want to only stop the service, but to remove everythin, including files, services, etc. Is that possible?
I am using Windows 8.1.
Upvotes: 13
Views: 49889
Reputation: 38
Reusing older posts to not reinvent the wheel...
1: The command...
C:\MongoDB\bin\mongod.exe --config C:\MongoDB\mongod.conf --remove
Is used to just remove the service.
NB: the configuration file may have the suffix .cfg.
2: Or you can use the Windows general way with:
sc delete MongoDB
NB: if you delete the MongoDB directory on the disk, you will still see MongoDB in the list of installed programs.
You can uninstall MongoDB automatically using a script doing something like this:
In Powershell, do:
Get-Package -Name 'MongoDB package name' | fl TagId
The 'MongoDB package name' is the name you can see in the control panel / Programs and features.
msiexec /x {TagId}
Replace the TagID string with the Id you find before.
Keep the {}.
Upvotes: 0
Reputation: 519
net stop MongoDB
: This will stop your mongo server(in case of windows) then simply delete that MongoDb folder.
Upvotes: 0
Reputation: 424
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:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MongoDB
(or just cut and paste this path)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
Upvotes: 22
Reputation: 11
.msi
.Upvotes: 1
Reputation: 1
Go to services.msc and stop MongoDb service .
Delete all the folders in C: drive where MongoDb Folders exists. Remove data folder if you created previously.
Type cmd in start and ryt click on cmd and select run as
administrator and type below Command. sc delete MongoDB If it throws some error like service not exists then open properties of the service and check whether you are giving the proper service name.
Upvotes: 0
Reputation: 151
Use the command below to delete the service:
sc delete MongoDB
Upvotes: 9
Reputation: 1554
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.
Upvotes: 8