À partir de la ligne de commande Windows. J'utilise MongoDB 3.4 Server sur Windows 7 Pro SP1 64 bits.
Les liens suivants expliquent les étapes :
configurer un service Windows pour l'édition communautaire de mongodb
créer manuellement un service Windows pour l'édition communautaire de Mongodb
La ligne de commande de la console suivante met fin à MongoDB au démarrage :
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\System32>"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe" --remove
2017-12-06T08:15:47.883-0600 I CONTROL [main] Trying to remove Windows service 'MongoDB'
2017-12-06T08:15:47.884-0600 I CONTROL [main] Service 'MongoDB' removed
La ligne de commande de création du service MongoDB (illustrée ci-dessous) se trouve dans le registre de Windows à cet endroit :
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MongoDB
Pour vérifier, procédez comme suit :
C:\Windows\System32>sc.exe create MongoDB binPath= "\"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe\" --service --c
onfig=\"C:\Program Files\MongoDB\Server\3.4\mongod.cfg\"" DisplayName= "MongoDB" start= "auto"
[SC] CreateService SUCCESS
C:\Windows\System32>net start MongoDB
The MongoDB service is starting.
The MongoDB service was started successfully.
C:\Windows\System32>net stop MongoDB
The MongoDB service is stopping.
The MongoDB service was stopped successfully.
C:\Windows\System32>"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe" --remove
2017-12-06T08:16:36.504-0600 I CONTROL [main] Trying to remove Windows service 'MongoDB'
2017-12-06T08:16:36.505-0600 I CONTROL [main] Service 'MongoDB' removed
C:\Windows\System32>
0 votes
Vous pouvez l'arrêter manuellement en utilisant "services.msc" à partir de cmd et en sélectionnant le service mongodb dans cette liste et en l'arrêtant.