Page 1 of 1

XAMPP With Live MySQL Database

PostPosted: 26. July 2012 23:02
by WAZ__Up
Hello, I'm trying to figure out how to use XAMPP with a database I have set up on my hosting site but it doesnt seem to want to connect to it.

This is what I'm using in my PHP Page:

$con = mysql_connect("sql.000webhost.com","Username","password");
mysql_select_db("username_db", $con);

This is the error I'm getting:

Warning: mysql_connect(): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\xampp\htdocs\SFGWebsite\index.php on line 88

Thank you.

Re: XAMPP With Live MySQL Database

PostPosted: 27. July 2012 14:50
by JonB
A couple of things

A. Some hosters don't allow remote connections (particularly on their cheapo plans).

B. The user you are authenticating as may not have wildcard host privileges -- i.e. the permissions may be for "user"@"localhost".

Good Luck
8)

Re: XAMPP With Live MySQL Database

PostPosted: 28. July 2012 00:24
by WAZ__Up
Can you explain the second part a little bit? and the "username" and "password" stuff actually has real and correct info, I just omitted it for security reasons in my post.

Re: XAMPP With Live MySQL Database

PostPosted: 28. July 2012 00:33
by JonB
In your database on the hosted server or VPS, the database user you authenticate with must have privileges for hosts other than 'localhost' (the default host).

http://dev.mysql.com/doc/refman/5.1/en/ ... names.html

Good Luck
8)