【问题标题】:mongo refusing connection on Ubuntu 16.04mongo 在 Ubuntu 16.04 上拒绝连接
【发布时间】:2022-02-12 01:17:13
【问题描述】:

Ubuntu 16.04

在终端上运行mongo 的控制台输出:

MongoDB shell version v3.6.3
connecting to: mongodb://127.0.0.1:27017
2018-03-27T18:23:41.006+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-27T18:23:41.006+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

【问题讨论】:

  • 尝试使用端口号 mongo --port 27020
  • 你运行mondodb服务器了吗?

标签: mongodb


【解决方案1】:

This answer @CodeGench 帮助解决了我的问题。在这样做之前,我已经尝试过卸载和重新安装以及各种不起作用的东西。

【讨论】:

    【解决方案2】:

    使用此命令

    sudo systemctl start mongod
    

    然后

    mongo
    

    【讨论】:

      猜你喜欢
      • 2017-08-29
      • 2019-06-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-05
      • 1970-01-01
      • 1970-01-01
      • 2016-09-02
      相关资源
      最近更新 更多