How to set environment variable for MongoDB in windows | MongoDB setting up the Environment Variable

Published: 16 June 2020
on channel: Engineers Revolution
12,292
92

Adding MongoDB to PATH Environment Variable in Windows
MySQL Installer by default doesn’t add the mongodb.exe to the PATH environment variable. As a result, every time we want to execute mongodb.exe we have to specify the full path to it. The mongodb.exe resides in the MongoDB\Server\4.2\bin directory. But the path to MongoDB directory depends upon the architecture of the application. If you have installed x64 version then it should be in C:\Program Files. Otherwise, it should be in C:\Program Files (x86). On this system, MySQL is installation is in C:\Program Files\ and the complete path to mongodb.exe is C:\Program Files\MongoDB\Server\4.2\bin
To add mongodb.exe to PATH environment variable follow these steps:

1. Hit Win+Pause/Break. This will open System Properties Window.

2. Click on Advanced system settings.

3. At the bottom of the newly opened window click on Environment Variables.

4. In the new window Select Path environment variable and click Edit.

5. Add ; at the end of the current variable value and append C:\Program Files\MongoDB\Server\4.2\bin(the exact may differ depending upon version and architecture of the application). Click OK to save.

Now start the Command Prompt and enter the following command:

mongo --version


Watch video How to set environment variable for MongoDB in windows | MongoDB setting up the Environment Variable online without registration, duration hours minute second in high quality. This video was added by user Engineers Revolution 16 June 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 12,292 once and liked it 92 people.