Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused

前端 未结 27 2567
孤街浪徒
孤街浪徒 2020-12-12 15:06

while trying this mongo command in ubuntu I am getting this error.

    ritzysystem@ritzysystem-Satellite-L55-A:~$ mongo
    MongoDB shell version: 2.6.1
             


        
27条回答
  •  死守一世寂寞
    2020-12-12 15:18

    Just some thoughts on my case.

    If you have changed the dbPath and logPath dirs to your custom values (say /data/mongodb/data, /data/mongodb/log), you must chown them to mongodb user, otherwise, the non-existent /data/db/ dir will be used.

    sudo chown -R mongodb:mongodb /data/mongodb/
    
    sudo service mongod restart
    

提交回复
热议问题