Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


PHP & MYSQL
New on LowEndTalk? Please Register and read our Community Rules.

PHP & MYSQL

BellaBella Member
edited May 2014 in Help

Hi I bought 4 shared hosting accounts (cPanel) from 4 different hosts.

I put the same php file on all of them.

<?php // Create connection $con=mysqli_connect("VPSIP","USERNAME","PASS","DBNAME"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } ?>

The php file connects to a MySql Database hosted on one of my VPS's.

The file is able to connect just fine from THREE of the hosts, but not the other one.

On my VPS i have the MYSQL User set so that it will allow connections from any ip.

So as far as I know, the host has to modify a setting on their server to allow external SQL Connections, does anyone know what they have to modify?

Comments

  • ricardoricardo Member

    by default MySQL does not bind to an external facing IP address, it only accepts connections from the local machine. They have to modify the 'listen' param in my.cnf so that it binds to an IP that external machines can connect to.

  • BellaBella Member

    I opened a ticket with the host and they resolved it. The firewall on the cPanel server was blocking out going SQL Connections.

  • MCHPhilMCHPhil Member, Provider

    egress filtering :D

    Transparency is key - Webhosting with a spine! - Live US based support, not to be confused with aliens.
Sign In or Register to comment.