运行OSX 10.9.2,我刚刚运行brew upgrade mongo
,将我的mongo
升级到版本2.6
根据我的说明
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
但现在当我运行mongo
时,它说
MongoDB shell version: 2.6.0
connecting to: test
2014-05-05T10:07:22.769+1000 warning: Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused
2014-05-05T10:07:22.770+1000 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
/data/db
文件夹,但之前不需要这样做,我也不想丢失我的数据mongo
的旧实例。无论如何,我尝试了它,并chown
编辑它以允许从我的用户帐户读/写,但这没有任何区别。 (仅供参考我的数据位于/usr/local/var/mongodb/
,这是我相信OSX的典型特征。)PHP
与我无关的土地。答案 0 :(得分:0)
我通过强制家酿来重新启动它来修复它。
brew services restart mongodb
和瞧
$ mongo
MongoDB shell version: 2.6.0
connecting to: test
>
现在有效。