Uninstalling MongoDB (Against Source Code Compilation)
Select an uninstallation mode based on the installation mode. If the MongoDB database is installed by compiling the source code, uninstall it by following the instructions in this section.
- Check and stop the database process. In this example, 36249 is the MongoDB process ID. Replace it with the actual one.
1 2
ps -ef | grep mongod kill -9 36249

- Delete the software installation directory and data directory of the database.
1 2
rm -rf /usr/local/mongo rm -rf /data/mongo

Parent topic: Uninstallation