Mongo Db — Installing on mac

I started learning Mongo .. and i was installing and i could not do it properly first then i followed few step which made my day!.

I am using Mac and i am installing mongo DB using brew.

1.Update the brew

brew update

2. Installing Mongo DB

brew install mongodb

3.I got the error “Run `brew link` on these:
 makedepend”

If you happen to get this error message, then just run this command in the terminal

brew link makedepend

then again, install the mongodb using brew install mongodb

4. Installing openssl, sometime it will be pre — installed.but its always better to run.

brew install mongodb –with-openssl

5.Creating the directory for mongo DB

mkdir -p /data/db

6. Setting up the permission to the directories.

sudo chmod 0755 /data/db

sudo chown $USER /data/db

That`s it! you have mongo on your mac.

To run the mongo,

1. In one terminal , write the command

mongod

2. Open a new terminal,in that terminal, write the command

mongo

That`s all!! you can start creating database or collection or documents.

References:

1.https://docs.mongodb.org/v3.0/tutorial/install-mongodb-on-os-x/

2.https://gist.github.com/adamgibbons/cc7b263ab3d52924d83b

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.