MONGO command Prompt "Connect failed"

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

Some time ago to learn some of the knowledge of MongoDB, think of hands-on practice, so with homebrew installed a bit of MongoDB:

$ Brew Update

$ Brew Install MongoDB

The use of the command before the installation of homebrew, midway may have interrupted the situation occurred, try a few more times just fine.

While I was cheerfully ready to practice, the MONGO command prompted "Connect failed".


Tidy up a bit of thought, should be the database service does not open the reason, so execute mongod command. See the error situation: There is no data directory configuration database.

This directory should be installed with no default value, so we have to manually configure the following. In the current user's documents directory, create a new mongo/db directory. Then execute the command:

$ mongod--dbpath ~/documents/mongo/db

The service can already be opened successfully at this time.

After configuring and starting the related service, execute the MONGO command again, OK, you can enter the world of MongoDB.


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.