Mysql Database Remote Connection

liunx

Guest
HI!<br />I am trying to connect to my homepagehomes.net mySQL database from a site hosted with godaddy(not my choice) and I am having the hardest time. I have no problem what so ever connecting to the database from other sites that I have hosted with you. I contacted godaddy to see if they allow connections to other remote databases and they do. This is their response:<br /><br />You are able to do a remote connection from our hosting to a database on another hosting with another company. Please keep in mind a few things though. 1) It will have to go through port 80 or port 443, and must be a http or https connection. 2) You will want to check with the other host to make sure that it allows external connections, and which ports it should connect to <br /><br />I have checked out the forums and know that this is possible. I have allowed access in the mySQL admin of homepagehomes.net with %. I am using Dreamweaver MX do the connections and it ask for:<br /><br />Connection Name: I make up the name<br />MySQL Sever: homepagehomes.net<br />Username: nhlzklc_IDX<br />Password: the one I created<br />THen I click on a button to pick the database and it won't go to that database. I get an error. I have tried everything from homepagehomes.net:3306 ... changing 3306 to 80 and 443. <br /><br />Here is the script that Dreamweaver will produce:<br /><br /><?php<br /># FileName="Connection_php_mysql.htm"<br /># Type="MYSQL"<br /># HTTP="true"<br />$hostname_conIDX = "homepagehomes.net";<br />$database_conIDX = "nhlzklc_idxdata";<br />$username_conIDX = "nhlzklc_IDX";<br />$password_conIDX = "password I created";<br />$conAdmin = mysql_pconnect($hostname_conAdmin, $username_conAdmin, $password_conAdmin) or trigger_error(mysql_error(),E_USER_ERROR); <br />?> <br /><br />What in the world am I doing wrong???<br /><br /> <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/surrender.gif" style="vertical-align:middle" emoid=":surrender:" border="0" alt="surrender.gif" /><!--content-->
Welcome to the forums 5FM <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><br /><br />Don't have an answer for you other than have them host their site here since you know you can connect to the db on the TCH servers.<br /><br />Maybe one of our members will have an answer for you.<!--content-->
Welcome to the forum, 5FM. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
Welcome to the forums, 5FM! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/thumbup1.gif" style="vertical-align:middle" emoid=":thumbup1:" border="0" alt="thumbup1.gif" /> <br /><br /><!--quoteo(post=184733:date=Jul 6 2006, 05:26 PM:name=5FM)--><div class='quotetop'>QUOTE(5FM @ Jul 6 2006, 05:26 PM) <a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=184733"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><div class='quotemain'><!--quotec-->You are able to do a remote connection from our hosting to a database on another hosting with another company. Please keep in mind a few things though. 1) It will have to go through port 80 or port 443, and must be a http or https connection.<!--QuoteEnd--></div><!--QuoteEEnd--><br />This doesn't make much sense. GoDaddy shouldn't care too much about what outgoing ports are used, and the port to connect to on the remote server (the MySQL database server) must be 3306. Also, connections to a MySQL database server are not http or https connections (a MySQL server is not a web server).<br /><br /><!--quoteo(post=184733:date=Jul 6 2006, 05:26 PM:name=5FM)--><div class='quotetop'>QUOTE(5FM @ Jul 6 2006, 05:26 PM) <a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=184733"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><div class='quotemain'><!--quotec-->Here is the script that Dreamweaver will produce:<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php<br /># FileName="Connection_php_mysql.htm"<br /># Type="MYSQL"<br /># HTTP="true"<br />$hostname_conIDX = "homepagehomes.net";<br />$database_conIDX = "nhlzklc_idxdata";<br />$username_conIDX = "nhlzklc_IDX";<br />$password_conIDX = "password I created";<br />$conAdmin = mysql_pconnect($hostname_conAdmin, $username_conAdmin, $password_conAdmin) or trigger_error(mysql_error(),E_USER_ERROR); <br />?><!--c2--></div><!--ec2--><!--QuoteEnd--></div><!--QuoteEEnd--><br />Assuming that there isn't another php script being imported, this script isn't using the variables that hold the connection information to actually connect to the MySQL server. In the last line of code, $hostname_conAdmin, $username_conAdmin, and $password_conAdmin should be $hostname_conIDX, $username_conIDX, and $password_conIDX.<br /><br />That's about all I can tell you, based just on what you've posted. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/huh.gif" style="vertical-align:middle" emoid=":huh:" border="0" alt="huh.gif" /><!--content-->
Welcome to the forums!<br /><br />JimE<!--content-->
Welcome to the forums. I saw the same coding error that TCH-David did; namely that the variables that contain the hostname, username, and password aren't the same variables that you call when you try to connect to the server, so that will obviously be a problem.<br /><br />Hope you get it working. Let us know.<!--content-->
Welcome to the forum, 5FM <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
Welcome to the forums! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /><!--content-->
Yes you are right. I forgot to change the variables. This still does not work. I have been trying everything. I just sent in another help ticket to godaddy to clearify their reponse about the port 80 and 443. I just need to come up with another solution till I can get this one solved. Ahhh! If anyone has another suggestion please let me know. <br /><br /><?php<br /># FileName="Connection_php_mysql.htm"<br /># Type="MYSQL"<br /># HTTP="true"<br />$hostname_conRES_Props = "homepagehomes.net:3306";<br />$database_conRES_Props = "nhlzklc_idxdata";<br />$username_conRES_Props = "nhlzklc_IDX";<br />$password_conRES_Props = "pasword here";<br />$conRES_Props = mysql_pconnect($hostname_conRES_Props, $username_conRES_Props, $password_conRES_Props) or trigger_error(mysql_error(),E_USER_ERROR); <br />?><br /><br /><br /><br /><br /> <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /><!--content-->
Did you try connecting to the IP, not the domain?<!--content-->
Yes. I tried the ip, the domain, the ip with the port, the domin with the port, even the ports godaddy suggested. I've tried all sorts of combinations. <br /><br /><br /><img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/wallbash.gif" style="vertical-align:middle" emoid=":wallbash:" border="0" alt="wallbash.gif" /><!--content-->
Okay I finally got an answer back from godaddy.com!<br /><br /><br />This is what they said:<br /><br />We apologize for the confusion about the port settings. We only allow outgoing connections on http (port 80) and https (port 443). If you are using https, the application must use a proxy server. The IP address of the proxy server is 64.202.165.130 and you will want to connect to it using port 3128.<br /><br /><br /><br />Then they gave me a link to a <b>sample</b> script.... where the heck do I put this?? In the connection file???<br /><br /><?<br /><br />$URL="https://www.paypal.com";<br />if (isset($_GET["site"])) { $URL = $_GET["site"]; }<br />$ch = curl_init();<br />echo "URL = $URL <br>\n";<br />curl_setopt($ch, CURLOPT_VERBOSE, 1);<br />//curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);<br />curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);<br />curl_setopt ($ch, CURLOPT_PROXY,"http://64.202.165.130:3128");<br />curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);<br />curl_setopt ($ch, CURLOPT_URL, $URL);<br />curl_setopt ($ch, CURLOPT_TIMEOUT, 120);<br />$result = curl_exec ($ch);<br />echo "<hr><br>\n";<br />echo 'Errors: ' . curl_errno($ch) . ' ' . curl_error($ch) . '<br><br>';<br />echo "<hr><br>\n";<br />curl_close ($ch);<br />print "result - $result";<br />echo "<hr><br>\n";<br /><br />?><br /><br /><br /><br /><br />??????<!--content-->
 
Back
Top