安装mongodb版本3.6.3后,mongo得到错误

时间:2018-03-14 13:32:14

标签: mongodb ubuntu-14.04

在成功安装mongoDB版本3.6.3后运行mongo时遇到问题。 我已经运行mongo推荐并得到以下错误

MongoDB shell version v3.6.3
    connecting to: mongodb://127.0.0.1:27017
    2018-03-14T18:57:02.928+0530 W NETWORK  [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
    2018-03-14T18:57:02.929+0530 E QUERY    [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
    connect@src/mongo/shell/mongo.js:251:13
    @(connect):1:6
    exception: connect failed

1 个答案:

答案 0 :(得分:0)

遇到同样的问题,我的错误是我是这个命令:

sudo mongo service mongod start

而不是:

sudo service mongod start

确保你运行第二个,希望这也是你的错误来源。