I have a php script which start a simple mysqli connection to a mariaDB database:
$db = @new mysqli( $mysql_host, $mysql_user, $mysql_pw, $mysql_db );
if (!$db->connect_error) {
$db->set_charset("utf8");
} else {
echo $db->connect_error;
exit;
}
This works, but sometimes I get the following $db->connect_error:
No such file or directory
One minute later it works again. What does this mean? How can I fix this?