I'm using cPanel on godaddy for my website, and my php script connects to the db of my dedicated server.
$servername = "hostip";
$username = "root";
$password = "pw";
$dbname = "dbname";
$port = "port";
$mysqli = mysqli_connect($servername, $username, $password, $dbname, $port);
if (!$mysqli) {
die("Connection failed: " . mysqli_connect_error());
}
?>
when I deploy the website in my localhost, and my friend's pc which is in different country, it connects to the db and everything works just fine, however when I deploy it in godaddy cPanel, I get this error. Connection failed: Can't connect to MySQL server on 'ip' (111).
I tried whitelisting the IP, checked firewall, but can't seem to find solution. I'm using mariaDB 5.5 for my server can anyone help? :(