简体   繁体   中英

How to uninstall mongodb from Windows

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.

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:

  1. win-key + r and run regedit
  2. Navigate to Computer\\HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\MongoDB (or just cut and paste this path)
  3. Once there right click on MongoDb and click Delete. Service is now gone.
  4. 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

Use the command below to delete the service:

  • run cmd as Administrator
  • sc delete MongoDB

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.

  1. Run the mongo-db installation file that ends with .msi .
  2. You'll see the remove option there, click on it.
  3. Then you could delete the mongo-db files that are in your computer.
  1. Go to services.msc and stop MongoDb service .

  2. Delete all the folders in C: drive where MongoDb Folders exists. Remove data folder if you created previously.

  3. 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.

net stop MongoDB :这将停止您的 mongo 服务器(在 Windows 的情况下),然后只需删除该 MongoDb 文件夹。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM