Unable to connect to mongodb Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:L112

后端 未结 17 996
不知归路
不知归路 2021-02-02 14:45

When ever I try to connect to mongo db I always get this error as below.

MongoDB shell version: 2.4.3 connecting to: test Fri Apr 26 14:31:46.941 JavaScript execution f

17条回答
  •  时光取名叫无心
    2021-02-02 15:12

    Faced same issue, my understanding is(it could be wrong)
    1. Make sure mongodb is up and running
    2. For linux access as sudo and for windows if connecting localhost turning off firewall may help but its not necessary
    3. Just type mongo, it will try to connect to localhost by default. You need to specify IP if you are connecting to a remote server. By default test db will be used.

提交回复
热议问题