当我尝试启动运行'mongo'的mongo shell时终端中的命令我收到此错误:
connecting to: mongodb://127.0.0.1:27017
2017-12-23T17:52:51.318+0100 W NETWORK [thread1] Failed to connect to
127.0.0.1:27017, in(checking socket for error after poll), reason:
Connection refused
2017-12-23T17:52:51.319+0100 E QUERY [thread1] Error: couldn't connect to
server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:237:13
@(connect):1:6
exception: connect failed
我无法弄清问题是什么......
答案 0 :(得分:0)
首先,您需要通过访问浏览器中的以下网址来检查mongo服务器是否在您的本地系统上运行。
http://127.0.0.1:27017
如果是ubuntu,你可以运行以下命令。
$ sudo service mongod start
然后,运行:
$ mongo