mongodb连接不上

 手机用户2502858457 发布于 2022-10-25 08:05

用mongovue连接时显示:

提示框里的代码如下:

Connection was refused
Unable to connect to server 127.0.0.1:27017: 由于目标计算机积极拒绝,无法连接。 127.0.0.1:27017.
Type: MongoDB.Driver.MongoConnectionException
Stack:    at MongoDB.Driver.Internal.DirectMongoServerProxy.Connect(TimeSpan timeout, ReadPreference readPreference)
   at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout)
   at MongoDB.Driver.MongoServer.Connect()
   at MangoUI.MMongo.Open(Boolean mustWrite)
   at MangoUI.MMongo.Open()
   at MangoUI.MConnection.get_IsValid()
   at MangoUI.WinConnect.btnTest_Click(Object sender, EventArgs e)


由于目标计算机积极拒绝,无法连接。 127.0.0.1:27017
Type: System.Net.Sockets.SocketException
Stack:    at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at System.Net.Sockets.TcpClient.Connect(IPEndPoint remoteEP)
   at MongoDB.Driver.Internal.MongoConnection.Open()
   at MongoDB.Driver.Internal.MongoConnection.GetNetworkStream()
   at MongoDB.Driver.Internal.MongoConnection.SendMessage(BsonBuffer buffer, Int32 requestId)
   at MongoDB.Driver.Internal.MongoConnection.SendMessage(MongoRequestMessage message)
   at MongoDB.Driver.Operations.CommandOperation`1.Execute(MongoConnection connection)
   at MongoDB.Driver.MongoServerInstance.RunCommandAs[TCommandResult](MongoConnection connection, String databaseName, IMongoCommand command)
   at MongoDB.Driver.MongoServerInstance.Ping(MongoConnection connection)
   at MongoDB.Driver.MongoServerInstance.Connect()
   at MongoDB.Driver.Internal.DirectMongoServerProxy.Connect(TimeSpan timeout, ReadPreference readPreference)
3 个回答
  • 『由于目标计算机积极拒绝,无法连接。 127.0.0.1:27017』

    是不是 bind_ip 到 127.0.0.1 了。

    2022-10-26 14:30 回答
  • Database那要填写你要连接的数据库名字,再测试连接一下看看能不能通过连接测试。。。

    2022-10-26 14:31 回答
  • 第一步确定你的mongo服务是否正常启动。测试方式为在mongo所在服务器用本地telnet 测试。排除mongo服务问题

    如果第一步成立,则换成同网段内telnet测试。如果无法访问,检测mongo所占用端口是不是被防火墙或杀软禁止了。如果是则在出入站规则中添加对应的出入站规则。排除防火墙,杀软的问题。

    最后在使用你的mongovue。

    2022-10-26 14:31 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有