mongo - couldn't connect to server 127.0.0.1:27017

后端 未结 30 2317
故里飘歌
故里飘歌 2020-11-27 09:43

I am coming from riak and redis where I never had an issue with this services starting, or to interact.

This is a pervasive problem with mongo and am rather clueless

30条回答
  •  醉梦人生
    2020-11-27 10:33

    In my case:

    First I open config file

    sudo vi /etc/mongodb.conf
    

    Comment IP and Port like this

    #bind_ip = 127.0.0.1
    #port = 27017
    

    Then restart mongodb

    sudo service mongodb restart
    sudo service mongod restart
    

    Finally, it's work :D

    finn@Finn ~ $ mongo
    MongoDB shell version: 2.4.9
    connecting to: test
    > exit
    

提交回复
热议问题