I have the same error with you, this is my case:
~
I type mongod to start the server and type control + c to exit the shell
then i type mongo and get
~
As you can see, my error information is the same as yours.
In this case, mongod does not start from the backend process, when I type control + c , I exit mongod.
We can add the --fork arguments to make the process a process daemon.
# mongod --logpath /usr/local/mongodb/log.txt --fork
you must install --logpath if you want to use --fork
then you will be able to connect to Mongo
bitfishxyz Jul 15 '18 at 5:47 2018-07-15 05:47
source share