Last active
August 6, 2023 12:08
-
-
Save dmmarmol/217ef9f7053a317b757c9a48f96099a9 to your computer and use it in GitHub Desktop.
Simple Batch file for running MongoDB on a windows computer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if not exist "C:\mongodb\data\db\" mkdir C:\mongodb\data\db | |
if not exist "C:\mongodb\data\log\" mkdir C:\mongodb\data\log | |
@echo off | |
:: Update the 3.4 if you have another version | |
cd C:\Program Files\MongoDB\Server\3.4\bin | |
::set default port variable | |
set port=27017 | |
:: add this line at the end of the ~mongod.exe to write the log on a separated file | |
:: --logpath C:\mongodb\data\log\mongo.log | |
start cmd /k mongod.exe --port %port% --dbpath C:\mongodb\data\db | |
start cmd /k mongo.exe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment