You can start MongoDB service by using following methods:
1. If you’re using Windows:
You can start the MongoDB service by using the Services console:
- Press “Win + R”, type “services.msc” and press “Enter” to open the Services console.
- Scroll down and find “MongoDB”. Right-click on it and choose “Start”.
Or in Command Prompt:
- Navigate to the bin directory in the MongoDB folder using command prompt. The default location is C:\Program Files\MongoDB\Server\3.2\bin on a 64-bit machine.
- Type “mongod” and press Enter.
1. If you’re using MacOS:
- If you installed MongoDB using Homebrew, you can use the command “brew services start mongodb-community@4.4”. Make sure to replace “4.4” with your MongoDB version.
Or through Terminal:
- Navigate to the location where you installed MongoDB and find the bin directory.
- Execute “./mongod” command.
1. If you’re using Linux:
- Open the Terminal.
- Type “sudo service mongod start” (without quotes) and press Enter.
Remember: You should replace “mongod” with “mongod.service” if you’re using “systemd”. Also, the MongoDB service needs to be installed as a service for these methods to work. If it’s not, you’ll need to run the MongoDB server manually.