2

I've got this error:

MongoDB\Driver\Exception\ConnectionTimeoutException: Failed to look up SRV record "_mongodb._tcp.training.gd45p.mongodb.net": No such file or directory

While executing this code:

$mongo = new MongoDB\Client("mongodb+srv://admin:{mypassword}@training.gd45p.mongodb.net/{db}?retryWrites=true&w=majority");

$db = $mongo->test->users;


$result = $db->insertOne(['name' => 'Tom', 'role' => 'admin']);

What does this error mean?

ISD
  • 984
  • 1
  • 6
  • 21
Mr.Newt
  • 41
  • 3
  • 4
  • DNS resolution is broken on your machine for SRV records or you have some weird PHP installation issue. – D. SM Aug 21 '20 at 13:58

0 Answers0