I'm trying to create a new connection in MongoVUE but I have an error : "Connection was refused".
The connection configuration is:
- Name: database
- Server: 127.0.0.1
- Port: 27017(default)
- Username: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)
How can I fix it and create connection? Help please.
Maybe you have solved this problem.I just provide how I solve for whom come with it later:
Open the browser, input the url
localhost:27017, you should find that the web page have words like"it seems that you attend to connect the mongodb", then go to step 3.If not go to step 2.
you should add the install directory to the path variable.
Then create a directory to store you db,for example"D:\data\db\".
Then input this command
mongod --dbpath D:\data\dbin the console, never close the console if you want to make connection.Then go step 3.
That is all.