MongoDB installation and configuration scenarios under Windows

Source: Internet
Author: User
Tags create mongodb

  1. First download the MongoDB installation package on the official website: https://www.mongodb.org/downloads

    Baidu Cloud Disk Download: http://pan.baidu.com/s/1slUSGYp (Installation version windows64 bit)

    Note: Download the appropriate version according to your computer system

  2. After downloading the selection (custom or default installation), after installing the file:

  3. Select the Build folder in the D drive named Mongond



  4. Set up the data and log folder in the D-Disk Mongondb folder. Used to hold the file. Log is used for logging.

  5. After unpacking the entire bin to the D-Disk Mongondb folder



  6. Select System ----> Advanced system settings ----> environment Variables ----> set PATH variable:

    Win7 you can right-click on the computer ---- Property After




    Add a Path variable value:;D: \mongondb\bin ( Note : semicolon + path)

  7. There is no way to take effect immediately after setting the environment variable, so restart the computer.

  8. After the reboot is complete, create a new profile Mongodb.config in the Mongondb folder on the D drive: The contents are as follows:

    # #数据文件

    Dbpath=d:\mongondb\data

    # #日志文件

    Logpath=d:\mongondb\log\mongodb.log

    # #错误日志采用追加模式, after configuring this option, the MongoDB log is appended to the existing log file instead of creating a new file

    Logappend=true

    #启用日志文件, enabled by default

    Journal=true

    #这个选项可以过滤掉一些无用的日志信息, set to False if you need to use Debug

    Quiet=true

    #端口号 defaults to 27017

    port=27017






  9. Open the cmd command line, run the above configuration file, after the run is complete, open the browser: http://127.0.0.1:27017/

  10. Open the Run command to test the MONGONDB run state, enter the command representation in the diagram: Display the database





  11. at this point, the successful operation of the mongodb, because every time such a routine startup is troublesome, how to solve this problem in order to facilitate the start-up convenience, the following introduction will be mongodb as windows service started.

    Commands are as follows:

    Mongod--config d:\mongoDB\mongo.config--install

    SC Way:

    The

    command is as follows:

    SC Create MongoDB binpath= "D:\mongoDB\bin\mongod.exe--service--config=d:\mongodb\mongo.config"

     

    Note: May be in win7 , win8 cannot be installed in the usual manner Please use SC mode

    picture with SC mode watch for  c:\windows\system32\cmd.exe

    under Run as Administrator " .



  12. At this point the MongoDB installation is complete. You can enter the command line services.msc to run the view .







    There's time to be quiet listen to the song write code, design a project, from beginning to end a project to develop a summary is also good.

    Organize some articles, nothing to write something, share some practical cool text.
    Public number "Information cool", no dream why far away, interested in children's boots can pay attention to see.



MongoDB installation and configuration scenarios under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.