0
Although I haven’t changed at all the settings of my Mysql database that has been working well for months, the connection has stopped working.
This is the PHP command I use to make the connection:
$this->link = @mysqli_connect($this->host,$this->user,$this->pass) or die("Sem conexão ". mysqli_connect_error());
Mysqli_connect_error returns this error message:
php_network_getaddresses: getaddrinfo failed: The requested name is valid, but no data of the requested type was found.
These are the UOL Host connection settings:
public $host = "djbteste.mysql.uhserver.com";
public $user = "********";
public $pass = "********";
public $db = "djbteste";
But it’s an intermittent mistake, it happens a few times throughout the day and only for a few minutes. I contacted the support (which is terrible!) of UOL Host, and they said that everything is fine with the database...
There may be some problem in the infrastructure that causes a package loss at peak times, one way around it would be for you to remove the
die()
and place the connection line within awhile
, to try a second or third time (but not too long) before interrupting execution.– Giovanni Nunes
thanks @Giovanninunes found interesting your suggestion and I will make this test.
– Romulo Rocha