zoukankan      html  css  js  c++  java
  • 启动mongodb报错,无法连接mongodb

    报错原因如下:

    MongoDB shell version v3.4.2
    connecting to: mongodb://127.0.0.1:27017
    2017-03-01T12:06:59.013+0800 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
    2017-03-01T12:06:59.015+0800 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

    试了好多方法都没有解决,最后解决办法如下:

    1> 进入终端,执行以下命令:

    brew services start mongodb

    2>再次启动即可:

    mongo

    查看mongodb安装目录:

    which mongodb
  • 相关阅读:
    20200816
    20200815
    20200813
    20200811
    20200810
    20200806
    20200804
    20200803
    20200802
    20200801
  • 原文地址:https://www.cnblogs.com/pengsi/p/7833508.html
Copyright © 2011-2022 走看看