Sorry I have ask the same question again from Robo 3T Error : Network is unreachable
Beacause I really can't find out the file /etc/mongod.conf
.
My machine is mac
and use homebrew
install mongodb
.
There is no mongod.conf
in my path /usr/local/var/mongodb
.
Any help would be appreciated.
According suggestion the path /usr/local/opt/mongodb/mongod.conf
Try brew uninstall mongo
and brew install mongo
.
Connect it still get the same error.
But find the file mongod.conf
in the path /usr/local/etc
.
I try to remove the file and restart mongodb server then type command mongo
get the error:
MongoDB shell version v4.0.2
connecting to: mongodb://127.0.0.1:27017
2018-09-18T14:38:21.241+0800 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:257:13
@(connect):1:6
exception: connect failed
It is so strange...:(