In my /usr/local/mongodb/mongod.conf file, I have
# Store data alongside MongoDB instead of the default, /data/db/
dbpath = /usr/local/mongodb_data
# Only accept local connections
bind_ip = 127.0.0.1
But when I try to run Mongo (on my mac), I get an error:
Wed Sep 14 09:29:35 [initandlisten] exception in initAndListen std::exception: dbpath (/data/db/) does not exist, terminating
So apparently the conf file is not being read
You must specify if you want it to use another config; there isn’t a default config file.
See Here:
File Based Configuration
To achieve what you want to do; you can either specify your config path or start your mongo server like: