How to install mongoDB on windows?

前端 未结 15 653
清歌不尽
清歌不尽 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:31

    I realize you've already accepted an answer for this, but I wrote this short howto article to install mongodb into the c:\wamp directory and run it as a service. Here is the gist of it.

    Create these directories

    mkdir c:\wamp\bin\mongodb\mongodb-win32...2.x.x\data
    mkdir c:\wamp\bin\mongodb\mongodb-win32...2.x.x\data\db
    mkdir c:\wamp\bin\mongodb\mongodb-win32...2.x.x\logs
    mkdir c:\wamp\bin\mongodb\mongodb-win32...2.x.x\conf
    

    Download and extract win32 binaries into c:\wamp directory along side mysql, apache.

    mongodb download page

    Create a mongo.conf file

    c:\wamp\bin\mongodb\mongodb-win32…2.x.x\conf\mongodb.conf
    
    # mongodb.conf
    
    # data lives here
    dbpath=C:\wamp\bin\mongodb\mongodb-win32...2.x.x\data\db
    
    # where to log
    logpath=C:\wamp\bin\mongodb\mongodb-win32...2.x.x\logs\mongodb.log
    logappend=true
    
    # only run on localhost for development
    bind_ip = 127.0.0.1                                                             
    
    port = 27017
    rest = true
    

    Install as a service

    mongod.exe --install --config c:\wamp\bin\mongodb\mongodb-win32...2.x.x\conf\mongodb.conf --logpath c:\wamp\bin\mongodb\mongodb-win32...2.x.x\logs\mongodb.log
    

    Set service to automatic and start it using services.msc

    Add path to mongo.exe to your path

    Need more details? Read the full article here...

    Installing MongoDB on Windows the WAMP way

提交回复
热议问题