MongoError: connect ECONNREFUSED 127.0.0.1:27017

后端 未结 21 1317
我在风中等你
我在风中等你 2020-12-14 08:40

I\'m using NodeJS wih MongoDB using mongodb package. When I run mongod command it works fine and gives "waiting for connection on port 27017". So, mongod seems to

21条回答
  •  情话喂你
    2020-12-14 08:44

    For Windows users.

    This happens because the MondgDB server is stopped. to fix this you can,

    1. 1 search for Services ,for that search using the left bottom corner search option.

      2 then there is a gear icon named with 'Services'.

      3 after clicking that you will get a window with lot of services

      4 scroll down and you will find 'MongoDB server (MongoDB)'.

      5 so you will see that there is an option to start the service.

      6 start it.

    2. 1 then open your command prompt.

      2 type mongod

    now you can connect to your server.

    this steps also working fine if your sql server service down. (find sql server services)

提交回复
热议问题