I have read up on the above error and from the way I understand, there could be many reasons that error pops up. I will try to be as specific as possible.
I have made a php file to do a simple database connect:
<?php
header('Access-Control-Allow-Origin: *');
$servername = "188.166.***.***";
$username = "root";
$password = "mypassword";
$dbname = "vod";
$con = new mysqli($servername,$username,$password,$dbname);
if($con->connect_error){
die("error ".$con->connect_error);
}
echo "success";
?>
When I run the above code I get the error:
Can't connect to MySQL server on 'XXX.XXX.XXX.XXXX' (111)
When I enter XXX.XXX.XXX.XXX
in the URL bar I am taken to the index.html
file of the server. And when I enter XXX.XXX.XXX.XXX/phpmyadmin
I am taken to phpmyadmin.
I hope I made my question clear.