To install MongoDB we don`t have to run ant exe file.All we have to do is download the zip file from the official MongoDB website.Depending upon the OS download 32 or 64 bit version zip files.
Unzip it and place the folder in a location .For Ex:D:\mongodb
Unzip it and place the folder in a location .For Ex:D:\mongodb
How to start the MongoDB server
- Open a command prompt and navigate to the mongodb\bin and issue the highlighted command.
- MongoDB
needs a data folder to flush the data .So we need to create the folder
manually(any location For Ex: D:\mongodb\data\db ) .Refer the screenshot
for any doubts.
mongod --dbpath "D:\mongodb\data\db"
- Once the server starts successfully the cursor starts blinking at the end .
Connect to MongoDB
- Open another command prompt without closing the first command prompt(as this will close the server).
- Navigate to the bin folder of the mongodb folder and issue the command as shown in the below screenshot.
mongo
Instead
of navigating each and every time to the installation location you can
set in the PATH varaible to execute it from any location.
No comments:
Post a Comment