XAMPP With Live MySQL Database

Problems with the Windows version of XAMPP, questions, comments, and anything related.

XAMPP With Live MySQL Database

Postby WAZ__Up » 26. July 2012 23:02

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.
WAZ__Up
 
Posts: 2
Joined: 26. July 2012 22:54
Operating System: Windows XP SP3

Re: XAMPP With Live MySQL Database

Postby JonB » 27. July 2012 14:50

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)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: XAMPP With Live MySQL Database

Postby WAZ__Up » 28. July 2012 00:24

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.
WAZ__Up
 
Posts: 2
Joined: 26. July 2012 22:54
Operating System: Windows XP SP3

Re: XAMPP With Live MySQL Database

Postby JonB » 28. July 2012 00:33

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)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 223 guests