0

This issue is happening automatically in the live server.

$mysqli = new mysqli("localhost","user","password","database");

if ($mysqli -> connect_errno) {
  echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
  exit();
}

When I refresh the page continues, some time works and sometimes returns php_network_getaddresses: getaddrinfo failed: System error

What could be the issue?

Dharman
  • 26,923
  • 21
  • 73
  • 125
  • 1
    `getaddrinfo failed` suggests that the server has been unable to resolve the name of your MySQL server. This really shouldn't happen with `localhost`, and certainly not intermittently. Talk to your hosting provider. – Tangentially Perpendicular Aug 18 '21 at 11:18

0 Answers0