Cannot connect to mongodb errno:61 Connection refused

前端 未结 13 1306
心在旅途
心在旅途 2020-12-04 05:38

I recently installed mongodb-2.6.0 with Homebrew. After successfully installed, I tried to connect using the mongo command. I am receiving the following errors

13条回答
  •  醉酒成梦
    2020-12-04 06:16

    I got this error after I upgraded to mongo 3.6 with homebrew.

    The log /usr/local/var/log/mongodb/mongo.log contained the message shutting down with code:62. This error code means that the existing database is too old to run with the current version of mongo.

    I found 2 solutions in another SO question:

    • Delete your database folder (/usr/local/var/mongodb)
    • Or follow the upgrade procedure

    I chose to upgrade. In my case, that meant I had to downgrade to 3.4, run a command in the mongo console, then upgrade again. Mongo requires you to upgrade one major version at a time, so depending on how far back you were, there could be additional steps. The docs will guide you.

    The brew switch * and brew services restart commands made swapping between versions relatively painless.

提交回复
热议问题