MongoVUE 连接失败

Failed connection in MongoVUE

我正在尝试在 MongoVUE 中创建新连接,但出现错误:"Connection was refused".

连接配置为:

  1. 名称:数据库
  2. 服务器:127.0.0.1
  3. 端口:27017(默认)
  4. 用户名:admin

Connection was refused Unable to connect to server 127.0.0.1:27017: Object reference not set to an instance of an object.. 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.QSDlL5xzK686iCExThO(Object ) at MangoUI.MMongo.Open(Boolean mustWrite) at MangoUI.MMongo.Open()
at MangoUI.MConnection.get_IsValid() at MangoUI.WinConnect.SCOjR9kYRPerNNngykW(Object ) at MangoUI.WinConnect.btnTest_Click(Object sender, EventArgs e)

Object reference not set to an instance of an object. Type: System.NullReferenceException Stack: at MongoDB.Driver.MongoServerInstance.RefreshStateAsSoonAsPossible()
at MongoDB.Driver.Internal.MongoConnection.HandleException(Exception ex) 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)

如何修复它并创建连接?请帮忙

也许你已经解决了这个problem.I只是提供我如何解决稍后与谁一起解决:

  1. 检查您的 mongodb 是否开启。
    打开浏览器,输入urllocalhost:27017,应该会发现网页中有"it seems that you attend to connect the mongodb"这样的字样,然后进入第3步。
    如果没有则进行第2步
  2. 让你的 mongodb 保持
    您应该将安装目录添加到路径变量中。
    然后创建一个目录来存放你的db,例如"D:\data\db\"。
    然后在控制台输入这个命令mongod --dbpath D:\data\db如果要建立连接就不要关闭控制台
    然后进行第 3 步。
  3. 使用 MongoBooster 而不是 MongVUE。 MongoVUE 是 2014 年以来的 nolooger 更新。但是,mongobooster 很好,支持 mongodb 从 2.2 到 3.2

就这些了。