troubleshooting Question

how to work with a remote mysql database ??

Avatar of altariamx2003
altariamx2003Flag for Mexico asked on
PHPMySQL Server
4 Comments1 Solution107 ViewsLast Modified:
I got two servers: "www.grupossc.com" with linux and "www.pvtcloudlab.com" with windows

in pvtcloudlab.com the page load his own database but also the mysql databse located in "www.grupossc.com", most of the time the system works without problems, but from time to time the page show you this error:
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:\Inetpub\vhosts\pvtcloudlab.com\httpdocs\users\Connections\dbnotes1.php on line 16

Fatal error: in C:\Inetpub\vhosts\pvtcloudlab.com\httpdocs\users\Connections\dbnotes1.php on line 16

that error reffers to this line:
$dbnotes1 = mysql_connect($hostname1, $username1, $password1) or trigger_error(mysql_error(),E_USER_ERROR);
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_dbnotes = "localhost";
$database_dbnotes = "xxxxxx";
$username_dbnotes = "xxxxxx";
$password_dbnotes = "xxxxxx";
$dbnotes = mysql_connect($hostname_dbnotes, $username_dbnotes, $password_dbnotes) or trigger_error(mysql_error(),E_USER_ERROR); 


$hostname1 = "www.grupossc.com";
$database1 = "xxxxxx";
$username1 = "xxxxxx";
$password1 = "xxxxxx";
$dbnotes1 = mysql_connect($hostname1, $username1, $password1) or trigger_error(mysql_error(),E_USER_ERROR);
?>

Anyone know why this error happend but just sometimes??? and it is  a way to solve it??????
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros