This Message Forum is no longer in use

Please use the new Bravenet Help Forums FOUND HERE

General Forum
This Forum is Locked
Author
Comment
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'sql4.bravehost.

Hi,

I am recieving an error when trying to connect to my SQL database using PHP (it is connecting externally) I am quite sure there is nothing wrong with the PHP script because i tried it with Java to and i get the same problem. I recieve the following error:

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'sql4.bravehost.com' (10060) in C:Documents and SettingsJamesDesktopxampplitehtdocstext.php on line 5
Connection Failure to Database

I can use phpMyAdmin to read the tables etc... But i cannot connect externally. Does bravenet block external connections?

Here is my PHP script by the way.

$dbuser="Username";
$dbpass="Password";
$dbname="highscores-750328"; //the name of the database
$chandle = mysql_connect("sql4.bravehost.com", $dbuser, $dbpass)
or die("Connection Failure to Database");
echo "Connected to database server
";
mysql_select_db($dbname, $chandle) or die ($dbname . " Database not found." . $dbuser);
echo "Database " . $database . " is selected";
mysql_close($chandle);
?>

I have deleted my username and password for obvious reasons.

If anyone could help me i would be very greatful!

Browser: james@killerscape.net,3

Re: Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'sql4.braveh

EDIT: I have just tried uploading the file to my bravenet host and it connects fine. Does this mean it only allows connections from my site? I need it to connect from my Java application as well =S

Browser: james@killerscape.net,3

Re: Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'sql4.braveh

no, you can use those same log on details to log in remotly(like you can have a database at google, have a site in yahoo and access it)

Re: Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'sql4.braveh

How can i make a new account so i can connect remotely then?

Browser: james@killerscape.net,3