Thursday, October 6, 2016

Installing MongoDB in Windows


Step-wise Installation on MongoDB Current Stable Release (3.2.10)


Download MongoDB from the below Url 


The trick here is to download the appropriate version of mongo. There are multiple types of mongo servers but we will use either of Community Server or Enterprise Server.
Community servers are used for development and testing purposes while enterprise edition is used for commercial purposes .
Also there are choices for 62bit/32bit . But all these installations are best supported in windows 7 and above.


Install the downloaded file with all default options.

Now, Create a directory anywhere which will serve as a root directory for our database.
e.g mkdir -p C:\mongo\data\db

Set the MongoDB installation path in environment Variable , if it is not already set.

By default installation directory is
C:\Program Files\MongoDB\Server\3.0\bin

Set above path in environment variable if you have used default installation directory.

Now we are ready to start MongoDB.
To start MongoDB  , Run the below command in command prompt:

mongod --dbpath c:\mongo\data\db

With --dbpath provide the path root directory created for sorting database.

If you see below screen without any prompt coming again, then no error has occurred and  MongoDB server is running Successfully.

To verify that mongo server is running ,Leave this command prompt running.Open new        command prompt and run below command.

mongo localhost:27017

This command will try to connect  to MongoDB server running on localhost on port 27017 (By default). If you have mongo running on some different IP and port (custom configuration), you can use those ip:port also.




Now if you see mongo shell running as shown in below screenshot , than MongoDB is successfully installed and running.








1 comment: