问题描述
$ mongo
$ mongo
MongoDB shell 版本 v3.6.3连接到:mongodb://127.0.0.1:270172018-10-18T17:09:03.003+0530 W NETWORK [thread1] 无法连接到 127.0.0.1:27017,在(轮询后检查套接字错误),原因:连接被拒绝2018-10-18T17:09:03.004+0530 E QUERY [thread1] 错误:无法连接到服务器 127.0.0.1:27017,连接尝试失败:connect@src/mongo/shell/mongo.js:251:13@(连接):1:6异常:连接失败
MongoDB shell version v3.6.3connecting to: mongodb://127.0.0.1:270172018-10-18T17:09:03.003+0530 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused2018-10-18T17:09:03.004+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:6exception: connect failed
推荐答案
您使用的是什么操作系统?在 ubuntu 中,您需要检查您的版本:
what OS are you using? In ubuntu you need to check your version:
service mongod status, mongod --version.
如果 mongod 已关闭,则只需重新启动并尽可能写入错误.
If mongod is off then just restart and write the error if possible.
service mongod restart
这篇关于连接到 mongodb 服务器时出现以下错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!