I was connected with my server using my server name.
$servername = "my server name here";
$username = "xxxxx";
$pass = "xxxx";
$dbname = "xxxx";
$conn = mysqli_connect ($servername, $username, $pass, $dbname);
die("Connection faild: ".mysqli_connect_error());
$conn->query("SET NAMES utf8");
Normally, using xampp in Windows, we will set server name be "localhost"
$servername = "localhost";
If you want other name, please set in hosts file:
And add "my_domain_name.com" (for example) into $servername variable