无法连接到mongodb errno:61连接被拒绝 [英] Cannot connect to mongodb errno:61 Connection refused

查看:373
本文介绍了无法连接到mongodb errno:61连接被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近用 Homebrew 安装了mongodb-2.6.0. 成功安装后,我尝试使用mongo命令进行连接.我收到以下不允许我连接的错误:

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 which do not allow me to connect:

Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused

Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146

exception: connect failed

推荐答案

当mongodb服务未在Mac上运行时,可能会发生这种情况.首先,我尝试了

It can happen when the mongodb service is not running on the mac. To start it, I tried

brew services start mongodb

它奏效了.

根据关于该PR关于自制软件的讨论: https://github.com/Homebrew/homebrew/issues/30628

According to the discussion on this PR on homebrew: https://github.com/Homebrew/homebrew/issues/30628

brew services已过时,我环顾四周,发现这些答案现在可以回答问题:

brew services is deprecated, I looked around on SO and found these answers now answer the question: What is the correct way to start a mongod service on linux / OS X?

这篇关于无法连接到mongodb errno:61连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆