Mongodb: failed to connect to server on first connect

前端 未结 13 3000
陌清茗
陌清茗 2020-12-15 15:52

I get the following error:

Warning { MongoError: failed to connect to server [mongodb:27017] on first connect
    at Pool. (/Users/michaelks         


        
13条回答
  •  生来不讨喜
    2020-12-15 16:22

    I ran into this issue serval times, and here is some troubleshooting list

    1. make sure database path is exist, the default path in windows in C:\data\db
    2. make sure mongo is running, to run it go to C:\Program Files\MongoDB\Server\3.4\bin and run the following:
      1. mongod.exe
      2. mongo.exe
    3. make sure that your connection string is correct like mongodb://localhost/database-name

提交回复
热议问题