我正在尝试通过Homebrew在OSX 10.8.3上首次安装mongo db。安装了Homebrew,然后安装了mongo,并被告知构建成功。但是,当我尝试使用mongo
命令启动mongo时,出现以下错误:
JavaScript execution failed: Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:L112
思想?
答案 0 :(得分:4)
运行brew info mongodb
以获取有关如何启动mongodb服务器的说明。它会说:
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
答案 1 :(得分:1)
当我在osx 10.8.4上通过自制软件安装mongo时,我遇到了这个问题。问题是mongod.conf文件被写入
/usr/local/etc/ instead of /usr/local/etc/mongod.conf