MongoDB Database Installation

Source: Internet
Author: User
Tags brew install mongodb install mongodb

Install and uninstall the installation

Use homebrew to install on Mac

    1. Update the package database for homebrew:
      brew update

    2. Installation:brew install mongodb

Then the following will appear

UpdatingHomebrew...==>Downloading HTTPS://homebrew.bintray.com/bottles/mongodb-3.4.4.sierra.bottleAlready downloaded: /users/liangma/library/caches/homebrew/mongodb-3.4.4.Sierra.Bottle.Tar.GZ==>Pouring MongoDB-3.4.4.Sierra.Bottle.Tar.GZ==>Using the Sandbox==>Caveatsto has launchd start MongoDB now and restart at login:Brew Services Start Mongodbor, ifYou don' t want/need a background service you can just run:Mongod--config/usr/local/etc/Mongod.conf==>Summary
    1. View all the software installed by homebrew
      js brew list
      This is where MongoDB appears in the list

      xieyushengdeMacBook-Pro:~ xieyusheng$ brew listautoconf    icu4c       libyaml     [email protected]1.1 watchmanautomake    libgpg-error    mongodb     pcrecoreutils   libksba     node        pkg-configflow        libtool     openssl     readline

      This means the installation is successful.

Unloading:

We're still going to unload it through homebrew.
js brew uninstall mongodb
And then when you look at the brew list, there's no mongdb.

Simple to use
    1. Start MongoDB
      js mongod --config /usr/local/etc/mongod.conf
    2. New Start Terminal Connection MDB
      js mongo
    3. View all databasesshow dbs
    4. Create a database use dataone (automatically created using it)
    5. View Current Databasedb
    6. Add data to the current databasedb.dataone.insert({"name":"xiaoming",age:12})
    7. Check Datadb.dataone.find()

      Note:

      MDB installs the default Mac installation path:
      /usr/local/mongodb

MongoDB Database Installation

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.