What I'm trying to do is connecting to server database from localhost.
$host = 'http://www.my-domain.com/phpmyadmin/';
$user = 'u5er';
$pass = 'pa55w0rd';
$db = 'db_name';
$con = mysqli_connect($host,$user,$pass,$db) or die("Error " . mysqli_error($con));
$sql = "SELECT col FROM test WHERE id = '1'";
$result = mysqli_query($con,$sql);
Errors
Warning: mysqli_connect(): in C:\xampp\htdocs\sp_concord\cenova_nabidka\page\vytvor.php on line 362
Warning: mysqli_connect(): in C:\xampp\htdocs\sp_concord\cenova_nabidka\page\vytvor.php on line 362
Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in C:\xampp\htdocs\sp_concord\cenova_nabidka\page\vytvor.php on line 362
Error
Is it possible to resolve it? How to find out if my server allows external connections? And how to define from which IP addresses it should allow access to database?
Thank you for any suggestion.
EDIT: Ok, I have changed the host to my-domain.com and now it reports the following errors. My IP has no acces to MySQL server...
Warning: mysqli_connect(): (HY000/1130): Host '88.146.210.54' is not allowed to connect to this MySQL server in C:\xampp\htdocs\sp_concord\cenova_nabidka\page\vytvor.php on line 362
Failed to connect to MySQL: Host '88.146.210.54' is not allowed to connect to this MySQL server
Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in C:\xampp\htdocs\sp_concord\cenova_nabidka\page\vytvor.php on line 368