我已经通过mongodb.com上的手册安装了mongoDB。 在终端中,我检查了状态,并且数据库正在运行:
Name Status User Plist
mongodb-community stopped
mongodb-community@3.6 stopped
mongodb-community@4.0 started vondramk /Users/vondramk/Library/LaunchAgents/homebrew.mxcl.mongodb-community@4.0.plist
尽管如此,我还是尝试(再次通过终端)与$ mongo
连接,这给了我这个错误:
连接响应包含错误:
MongoDB shell version v4.2.1
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
2019-12-17T08:35:23.648+0100 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2019-12-17T08:35:23.651+0100 F - [main] exception: connect failed
2019-12-17T08:35:23.651+0100 E - [main] exiting with code 1
有人可以指导我如何解决此问题吗?