无法连接到mongoDB获取错误

时间:2015-10-11 06:14:58

标签: php mongodb

HI我正在尝试在Ubuntu上安装mongo数据库,并在安装后运行命令mongo时出现此错误:

MongoDB shell version: 3.0.6
connecting to: test
2015-10-11T11:43:29.448+0530 W NETWORK  Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-10-11T11:43:29.449+0530 E QUERY    Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed
    at connect (src/mongo/shell/mongo.js:179:14)
    at (connect):1:6 at src/mongo/shell/mongo.js:179
exception: connect failed

由于

1 个答案:

答案 0 :(得分:0)

检查mongodb服务是否与service mongod status

一起运行

如果不是 - 请运行sudo service mongod start

Run MongoDB