If someone can provide some insights here I would GREATLY appreciate it.
I am new to MongoDB, and (relatively) new to the command line.
I had a express/node.js app running on MongoDB locally successfully, but upon restarting my computer, I attempted to restart the Mongo server and it began giving errors and wouldn't start. Since then, I have re-installed Mongo several times only to find the same error occurring. this is what I am receiving:
privee:mongodb-osx-x86_64-2.4.6 jonlinton$ ./bin/mongo MongoDB shell version: 2.4.6 connecting to: test Mon Aug 26 14:48:47.168 Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145 exception: connect failed
Am I missing a step? Should I be creating a config file? Some basic guidance would be really helpful. Thanks in advance for any insights.
Assuming you have created the data/db directory under bin after install.
Run the command
Start a terminal for your mongo shell
Run the command (make sure you put the name of the database)
If you have installed mongodb through
homebrew then you can simply start mongodb through
brew services start mongodb
Then access the shell by
You can shut down your db by
brew services stop mongodb
You can restart your db by
brew services restart mongodb
For more options
brew info mongodb