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

前端 未结 8 1251
灰色年华
灰色年华 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:27

    MAC: For my case I forgot to turn on mongo server locally, so I fixed the issue by firstly open a new tab on terminal then turn on mongodb server like so: -

    mongod 
    

    After that just try to open mongo shell again like so: -

    mongo 
    

    Finally it worked!

提交回复
热议问题