Hi,
I'am trying to connect with a php script to connect to an external mysql database.
But i think cpanel/whm is blocking somewhere external connections.
Things that i already have done:
if i run in ssh:
mysql -u sql_username -h sql_ipadres -P 7999 -p i have successfully connection to external database. (so firewall accept outgoing connection port 7999)
If i run on php file:
I get an error
I'am 100% that the credentials are right so that is not the problem.
So something change the external ip-adres to local-ipadres. So i think i have to enable something, but i don't know where?
Is it possible that mysqli can't connect to a external DB?
The script is running on PHP 7.2
I'am trying to connect with a php script to connect to an external mysql database.
But i think cpanel/whm is blocking somewhere external connections.
Things that i already have done:
if i run in ssh:
mysql -u sql_username -h sql_ipadres -P 7999 -p i have successfully connection to external database. (so firewall accept outgoing connection port 7999)
If i run on php file:
PHP:
$conn = new mysqli("$ip_externhost","$user","$password","$DB","$port");
Code:
Failed to connect to MySQL: Access denied for user '$user'@'localipadres' (using password: YES)
So something change the external ip-adres to local-ipadres. So i think i have to enable something, but i don't know where?
Is it possible that mysqli can't connect to a external DB?
The script is running on PHP 7.2