Couldn't connect to server 127.0.0.1:27017 connection attempt failed MongoDB

前端 未结 8 1256
灰色年华
灰色年华 2021-02-04 17:05

I am working on Ubuntu OS 16.04. I am starting mongodb using commands:: sudo service mongod start and then mongo

It generated this error for m

8条回答
  •  孤独总比滥情好
    2021-02-04 17:23

    This error occurs when your mongodb server is not running on 27017 port. Try the below command to start the mongodb server.

    sudo systemctl start mongod
    

    And after running this command run the mongo command.

提交回复
热议问题