1.安装MongoDB:
brew tap mongodb/brew
brew install mongodb-community
后台服务方式运行mongodb:
brew services restart mongodb/brew/mongodb-community
直接运行mongodb非后台服务
/usr/local/opt/mongodb-community/bin/mongod --config /usr/local/etc/mongod.conf
客户端成功连接mongodb
后台服务方式启动mongodb服务报错