1

I am trying to connect to mongodb from Devart unidac components and I supplied server name like this, I right click on the UniConnection1 and choose "connection editor" and I enter connection parameters:

Server:

cluster0-shard-00-00-xxxxx.mongodb.net

also port 27017, user name and password but I did not able to connect from Delphi although I was able to connect from mongodb compass. Any advise ?

here is the error I get

Failed to read 66321 bytes from socket within 300000 milliseconds..

I am trying to connect to MongoDB Atlas not a local server

zac
  • 4,495
  • 15
  • 62
  • 127
  • Have you tried adding protocol `mongodb://`? – Victoria Mar 04 '18 at 23:30
  • @Victoria tried now did not work I get invalid URI. I right click on the unidac connection component and I enter parameters in the dialog box. – zac Mar 04 '18 at 23:34
  • Which version of driver do you use (3.6 or later or 3.4 and earlier)? – Victoria Mar 04 '18 at 23:57
  • @Victoria how I can know that ? – zac Mar 05 '18 at 00:03
  • [You are probably using](https://www.devart.com/unidac/docs/index.html?mongoprov_article.htm#requirements) C driver libmongoc behind (official cloud services has [different connection strings for different versions](https://docs.atlas.mongodb.com/driver-connection/#c-driver-example)). I don't know where did you get your client library :) – Victoria Mar 05 '18 at 00:30
  • I saw this page. I tried with and without specifying libmongoc-1.0.dll and libbson-1.0.dll. They are in tokyo bin folder any way I enter connection parameters into the connection dialog box. see this https://imgur.com/a/LnZwo – zac Mar 05 '18 at 00:42
  • 2
    Well, I don't know its version. It doesn't have a version information nor `mongoc_get_version` function included. You need to know your client library version as the cloud requires different connection strings. If I were you, I would download the latest one. – Victoria Mar 05 '18 at 01:16
  • @Victoria ok will do thanks – zac Mar 05 '18 at 01:18
  • 1
    FYI, FireDAC (not UniDAC) with the driver shipped with Tokyo ended up on _"No acceptable peer could be found."_ when trying to connect to the cluster. With driver v1.9.3 I was able to connect. – Victoria Mar 05 '18 at 04:22

2 Answers2

0

I was using old version of unidac 7.1.4 whenI upgraded I was able to connect normally with also devart odbc dlls

zac
  • 4,495
  • 15
  • 62
  • 127
0

maybe, you don't start your MongoDB service!

youki
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 18 '22 at 07:08