Install and configure mongoDB on Mac OS

Source: Internet
Author: User
Tags mongodb commands mongodb server


Installing mongoDB on Mac OS is actually very simple. You can follow the detailed steps on the official website. The following describes my steps and configuration methods. My Mac OS version is 10.6, and the tools used include terminals, emacs www.2cto.com 1, go to http://www.mongodb.org/downloadsdownload mongodbpackage, and my selection is mongodb-osx-x86_64-2.0.4
2. After downloading the package, decompress it to any directory (of course, it is best to place a suitable Directory, which is a bad habit). After decompression, you can find a "bin" directory, directory for storing mongoDB commands
3. run the "mkdir-p/data/db" command to create the data/db directory under "/". This is the directory for storing mongoDB data, I tried to start mongoDB without creating this directory. The result is "exception in initAndListen: 10296 dbpath (/data/db/) does not exist, terminating ", this directory is not only mandatory but will not be automatically created. I don't know if I can change the directory to put data.
4. Go to the "bin" directory and run the "./mongod" command to start mongoDB server. Do not close the terminal after startup.
5. Open another terminal window. For convenience, go to the "bin" directory and run the command ". /mongo ", you can see that the mongoDB Console appears on the terminal, then you can use any mongoDB command to operate mongoDB data, just like using the mysql command line to operate mysql, www.2cto.com 6. For convenience, add the bin directory of mongoDB to the environment variable. The specific method is to edit "~ "Under the. bash_profile file (if not found, create your own), PATH ="/../mongodb/bin:... "export PATH reference documentation: http://www.mongodb.org/display/DOCS/Quickstart+ OS +X
Author jrkui

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.