I know this same warning has been asked many times here. But in all the queries I saw some mistake in the program because of which the user was not able to access the database.
But in my case I am accessing directly using the user which has access rights to the database, but even then this warning is coming
php_network_getaddresses: getaddrinfo failed: No such host is known
<?php
$conn_error = 'Could not connect.';
$mysql_host = 'localhost';
$mysql_user = 'root';
$mysql_pass = '';
$mysql_db = 'a_database';
if(!mysqli_connect('mysql_host','mysql_user','mysql_pass','mysql_db')){
die($conn_error);
}
else{
echo 'connected';
}
It is giving the error message of not connected.
Although the users have the privilege to access the database.