運行mongod
指令,可以啟動mongoDB
這應該算是成功了吧?
但是運行mongo
的話,終端會報出這樣的錯誤:
MongoDB shell version: 3.2.7 connecting to: test 2017-01-31T12:56:00.745+0800 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused 2017-01-31T12:56:00.745+0800 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed : connect@src/mongo/shell/mongo.js:229:14 @(connect):1:6 exception: connect failed
不知道是為什麼~求教,謝謝!
MongoDB是用homebrew裝的?
是的話先launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
然後運行mongod