简体   繁体   English

如何从 Windows 卸载 mongodb

[英]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.但该命令不起作用,因为我的 Windows 的 mongodb 文件夹中没有mongod.conf文件。 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.我正在使用 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:如果您没有mongod.conf和/或不再有.msi安装程序(谁保留这些东西?)然后:

  1. win-key + r and run regedit win-key + r 并运行 regedit
  2. Navigate to Computer\\HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\MongoDB (or just cut and paste this path)导航到Computer\\HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\MongoDB (或者只是剪切并粘贴此路径)
  3. Once there right click on MongoDb and click Delete.在那里右键单击 MongoDb 并单击删除。 Service is now gone.现在服务没了。
  4. Goto C:\\mongodb (or where you installed it) and delete directory.转到 C:\\mongodb (或您安装它的位置)并删除目录。 Mongodb is now gone. Mongodb 现在不见了。

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.或者,您可以重新下载 msi 并尝试使用它。

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编辑:如果您忘记先停止服务或者它在服务中留下了死孤儿,则以管理员身份打开 CMD 或其他 shell 并运行命令:sc.exe delete MongoDB ...您应该看到:[SC] DeleteService SUCCESS

Use the command below to delete the service:使用以下命令删除服务:

  • run cmd as Administrator以管理员身份运行cmd
  • sc delete MongoDB

Since you're using Windows, just run the same .msi file that you installed it with.由于您使用的是 Windows,只需运行安装时使用的相同.msi文件即可。

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.打开文件后,按下一步,您将拥有删除 MongoDB 安装的完整访问权限。

  1. Run the mongo-db installation file that ends with .msi .运行以.msi结尾的 mongo-db 安装文件。
  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.然后您可以删除计算机中的 mongo-db 文件。
  1. Go to services.msc and stop MongoDb service .转到 services.msc 并停止 MongoDb 服务。

  2. Delete all the folders in C: drive where MongoDb Folders exists.删除 MongoDb 文件夹所在的 C: 盘中的所有文件夹。 Remove data folder if you created previously.如果您之前创建,请删除数据文件夹。

  3. Type cmd in start and ryt click on cmd and select run as在开始输入 cmd 并点击 cmd 并选择运行方式

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. sc delete MongoDB 如果它抛出一些错误,如服务不存在,则打开服务的属性并检查您是否提供了正确的服务名称。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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