无法连接到服务器127.0.0.1:27017连接尝试失败MongoDB

编程入门 行业动态 更新时间:2024-10-23 13:35:05
本文介绍了无法连接到服务器127.0.0.1:27017连接尝试失败MongoDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用Ubuntu OS 16.04.我正在使用以下命令启动mongodb :: sudo service mongod start然后 mongo

I am working on Ubuntu OS 16.04. I am starting mongodb using commands:: sudo service mongod start and then mongo

它为我生成了此错误::

It generated this error for me::

MongoDB shell version v4.0.1 connecting to: mongodb://127.0.0.1:27017 2018-09-27T16:50:41.345+0530 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused : connect@src/mongo/shell/mongo.js:257:13 @(connect):1:6 exception: connect failed

现在我无法启动mongodb.如何解决此错误以及这些错误的原因是什么. 我针对此问题尝试了所有解决方案,但没有找到任何解决方案.

Now I am not able to start mongodb. How to resolve this error and what are the causes of these error. I tried all of solution for this problem but didn't find any solution.

推荐答案

mongod --repair对我有用,

mongod --repair worked for me ,

sudo mongod --repair sudo mongod

然后打开其他选项卡/终端:

Then open a different tab/terminal:

mongo

此后,您的本地设置将正常运行

After this your local setup will work properly

更多推荐

无法连接到服务器127.0.0.1:27017连接尝试失败MongoDB

本文发布于:2023-11-02 14:54:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1552694.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:连接到   服务器   MongoDB

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!