/$ mongo
MongoDB shell version: 3.2.8
connecting to: test
2018-08-28T10:11:30.005+0800 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2018-08-28T10:11:30.005+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
错误:此命令是启动本地客户端,需要现在本机开启sudo mongod
解决:先执行本地 /$ sudo mongod,再开一个新终端 /$ mongo(客户端默认127.0.0。1)