Neli Chakarova
Neli Chakarova

Reputation: 660

Install MongoDB with Homebrew and /data/db clarifications

I am just starting with MongoDB and I am trying to figure out how to set it up properly. What I did is simply install it with Homebrew and created the folder /data/db as it is specified in the documentation.

The thing I got confused about was caused by this paragraph from the documentation:

Run without specifying paths

If your system PATH variable includes the location of the mongod binary and if you use the default data directory (i.e., /data/db), simply enter mongod at the system prompt:

I don't see the path to the directory mongodb in my PATH variable. But since I am not sure how Homebrew is handling that, I don't know whether I should add it by myself. In the documentation this step is added only when you would install Mongo manually.

The other thing I am uncertain about is where the /data/db folder should reside. So far I have it at root level, after I ran:

mkdir -p /data/db

Should it be somewhere inside the directory mongodb?

Any help will be much appreciated!

Upvotes: 0

Views: 653

Answers (3)

Jason
Jason

Reputation: 359

It installs by default at root level. Theres no need to move it into a mongodb directory.

Upvotes: 1

Gourab Sarkar
Gourab Sarkar

Reputation: 80

If you are using windows system then you have to set in classpath like

C:\Program Files\MongoDB\Server\3.2\bin

and data/db folder you have to create in Root drive or C drive.In this folder your all databases will be stored.

Upvotes: 0

Ronnin
Ronnin

Reputation: 15

  • Default installations make folder in /var/lib/mongod

    • paths are defines in /etc/mongo.conf

Upvotes: 0

Related Questions