Sunday, January 14, 2018

MongoDB Binary Installation - Windows

Binary Installation





Community server -> windows -> All Version Binaries. When you do this, the below page will open in the other tab.




Here select the version of mongodb you need to install. As soon as you click on the link, it will get downloaded in the downloads folder


Extract the downloaded zip file

Prerequisite to run mongo server

Rename the extracted file if required to have the easy access and create a data directory as per your convenient – I have done it in downloads folder itself 

C:\Users\tommy\Downloads\mongo_server

                          

C:\Users\tommy\Downloads\mongo_data


Run MongoDB Server

Go till bin path  where the mongodb is installed– and copy it,

C:\Users\tommy\Downloads\mongo_server\bin



Copy the data directory as well,

C:\Users\tommy\Downloads\mongo_data






Open Command Prompt

Run the below commands,

# cd C:\Users\tommy\Downloads\mongo_server\bin
# mongod –dbpath C:\Users\tommy\Downloads\mongo_data



As soon as you executed this, a prompt shown below will occur -> Allow access



By then, the server starts running listening to the default port  27017 as shown below.



As soon as you start the mongo server, the default files will get generated as shown below in the data directory.



Start the Mongo Client

      1)      Keep the server running in one command prompt
      2)      Open another new command prompt

      Run the below commands,

# cd C:\Users\tommy\Downloads\mongo_server\bin
# mongo






You can query and see as well,



Done…












No comments:

Post a Comment