The two important roles for a user are userAdmin and userAdminAnyDatabase. To make mongodb as authenticated login, we have to pass -auth parameter while installing its service.īefore installing a service with authentication, we have to create a user with required role that can easily login in authenticated development environment and do required operations.įor getting information about all the roles of a user follow this link Now we will be saving this data to d:\mongodb\data folder. In this step we will try to setup mongodb by our custom configurations.īy default data directory for mongodb is c: \data. Check at the URL to verify that MongoDB returns stats.Echo logpath=D:\mongodb\log\mongo.log > D:\mongodb\mongod.cfg.Open ComponentServices, click on "Services (Local)", and find the MongoDB service.Save the changes to the registry and exit the registry editor. Open the registry editor (regedit.exe), go to HKEY_LOCAL_MACHINE → SYSTEM → CurrentControlSet → Services.įind the MongoDB key and set the "ImagePath" value to: C:\mongodb165\bin\mongod -service -rest -master -logpath=C:\mongodb165\logs\mongolog.txt -dbpath=C:\mongodb165\data Change the directory to "C:\mongodb165\bin".Įxecute the following command: mongod -install -rest –master –logpath=C:\mongodb165\logs\mongolog.txt.Add a log file name "mongolog.txt" at "C:\mongodb165\logs\mongolog.txt".
#Start mongodb windows command line download#
To save you the time of reading the whole back and forth discussion, Tad Marshalls post sums up this issue: This message has been discussed thoroughly at. The pipe has been ended." You may see it as well. Note that if you direct copy this ImagePath value and your "data" folder is in the mongodb directory instead of C:\ add the following line to your "mongod.cfg" file: dbpath=C:\mongodb\data\dbĪfter I did this, when I run "net stop MongoDB" I get the message "System error 109 has occurred. Paste in the following ImagePath ( edit the folder directory and names to match your needs ): C:\mongodb\bin\mongod.exe -service -rest -master -logpath=C:\mongodb\log\mongolog.txt -dbpath=C:\mongodb\data\db -config C:\mongodb\mongod.cfg Go to HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > services > MongoDBĭouble click ImagePath under the Name column If you already installed MongoDB according to their docs and want to be able to execute "net start MongoDB" from where ever your project directory is: I didn't want to go back and reinstall MongoDB to follow the instructions included in the Webiyo link referenced above though. I followed the directions in MongoDBs Docs for the install, but it wouldn't let me execute "net start MongoDB" unless I was in "C:\".
#Start mongodb windows command line windows 7#
I just encountered the same issue on my windows 7 machine.