How to install mongoDB on windows?

前端 未结 15 640
清歌不尽
清歌不尽 2020-11-29 14:55

I am trying to test out mongoDB and see if it is anything for me. I downloaded the 32bit windows version, but have no idea on how to continue from now on.

I normally

15条回答
  •  抹茶落季
    2020-11-29 15:33

    Its very simple to install Mongo DB on windows 7 ( i used 32 bit win7 OS)

    1. Install the correct version of Mongodb ( according to ur bit 32/64 .. imp :- 64 bit is not compatible with 32 bit and vice versa)

    2.u can install Mongodb from thius website ( acc to ur OS) http://www.mongodb.org/downloads?_ga=1.79549524.1754732149.1410784175

    1. DOWNLOAD THE .MSI OR zip file .. and install with proper privellages

    4.copy the mongodb folder from c:programfiles to d: [optional]

    5.After installation open command prompt ( as administrator .. right click on cmd and u will find the option)

    1. navigate to D:\MongoDB 2.6 Standard\bin

    2. run mongo.exe ... you might get this error you might get this error

    3. If you get then no isse you just need to do following steps

    i) try the coomand in following image yo will get to know the error enter image description here

    ii)This means that u neeed to create a directory \data\db

    iii) now you have two options either create above directory in c drive or create any "xyz" name directory somewhere else ( doesnot make and diffrence) .. lets create a directory of mongodata in d:

    enter image description here

    1. Now lets rerun the command but now like this :- mongod --dbpath d:\mongodata [shown in fig] this time you will not get and error

    enter image description here

    1. Hope everything is fine till this point .. open new command propmt [sufficent privellages (admin)]

    colured in orange will be the command u need to run .. it will open the new command propmt which we known as mongo shell (or mongodb shell)

    enter image description here

    11.dont close the shell[any of command promt as well] as in this we will create /delete/insert our databse operations

    1. Lets perform basic operation

    a) show databases b) show current databse c) creation of collection / inserting data into it (name will be test) d) show data of collection

    12.please find scrren shot of results of our operation .. please not :- dont close any command propmt

    enter image description here

    1. a diffrent structure type of number is object id :- which is created automatically

    2. Hope you get some important info for installing mongodb DB.

提交回复
热议问题