5FM Posted July 7, 2006 Share Posted July 7, 2006 HI! 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: 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 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: Connection Name: I make up the name MySQL Sever: homepagehomes.net Username: nhlzklc_IDX Password: the one I created 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. Here is the script that Dreamweaver will produce: <?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_conIDX = "homepagehomes.net"; $database_conIDX = "nhlzklc_idxdata"; $username_conIDX = "nhlzklc_IDX"; $password_conIDX = "password I created"; $conAdmin = mysql_pconnect($hostname_conAdmin, $username_conAdmin, $password_conAdmin) or trigger_error(mysql_error(),E_USER_ERROR); ?> What in the world am I doing wrong??? Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted July 7, 2006 Share Posted July 7, 2006 Welcome to the forums 5FM 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. Maybe one of our members will have an answer for you. Quote Link to comment Share on other sites More sharing options...
TCH-Thomas Posted July 7, 2006 Share Posted July 7, 2006 Welcome to the forum, 5FM. Quote Link to comment Share on other sites More sharing options...
TweezerMan Posted July 7, 2006 Share Posted July 7, 2006 Welcome to the forums, 5FM! 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. 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). Here is the script that Dreamweaver will produce: ><?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_conIDX = "homepagehomes.net"; $database_conIDX = "nhlzklc_idxdata"; $username_conIDX = "nhlzklc_IDX"; $password_conIDX = "password I created"; $conAdmin = mysql_pconnect($hostname_conAdmin, $username_conAdmin, $password_conAdmin) or trigger_error(mysql_error(),E_USER_ERROR); ?> 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. That's about all I can tell you, based just on what you've posted. Quote Link to comment Share on other sites More sharing options...
TCH-JimE Posted July 7, 2006 Share Posted July 7, 2006 Welcome to the forums! JimE Quote Link to comment Share on other sites More sharing options...
abinidi Posted July 7, 2006 Share Posted July 7, 2006 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. Hope you get it working. Let us know. Quote Link to comment Share on other sites More sharing options...
TCH-Don Posted July 7, 2006 Share Posted July 7, 2006 Welcome to the forum, 5FM Quote Link to comment Share on other sites More sharing options...
Samrc Posted July 8, 2006 Share Posted July 8, 2006 Welcome to the forums! Quote Link to comment Share on other sites More sharing options...
5FM Posted July 8, 2006 Author Share Posted July 8, 2006 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. <?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_conRES_Props = "homepagehomes.net:3306"; $database_conRES_Props = "nhlzklc_idxdata"; $username_conRES_Props = "nhlzklc_IDX"; $password_conRES_Props = "pasword here"; $conRES_Props = mysql_pconnect($hostname_conRES_Props, $username_conRES_Props, $password_conRES_Props) or trigger_error(mysql_error(),E_USER_ERROR); ?> Quote Link to comment Share on other sites More sharing options...
TCH-Tim Posted July 8, 2006 Share Posted July 8, 2006 Did you try connecting to the IP, not the domain? Quote Link to comment Share on other sites More sharing options...
5FM Posted July 8, 2006 Author Share Posted July 8, 2006 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. Quote Link to comment Share on other sites More sharing options...
5FM Posted July 9, 2006 Author Share Posted July 9, 2006 (edited) Okay I finally got an answer back from godaddy.com! This is what they said: 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. Then they gave me a link to a sample script.... where the heck do I put this?? In the connection file??? <? $URL="https://www.paypal.com"; if (isset($_GET["site"])) { $URL = $_GET["site"]; } $ch = curl_init(); echo "URL = $URL <br>\n"; curl_setopt($ch, CURLOPT_VERBOSE, 1); //curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE); curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); curl_setopt ($ch, CURLOPT_PROXY,"http://64.202.165.130:3128"); curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt ($ch, CURLOPT_URL, $URL); curl_setopt ($ch, CURLOPT_TIMEOUT, 120); $result = curl_exec ($ch); echo "<hr><br>\n"; echo 'Errors: ' . curl_errno($ch) . ' ' . curl_error($ch) . '<br><br>'; echo "<hr><br>\n"; curl_close ($ch); print "result - $result"; echo "<hr><br>\n"; ?> ?????? Edited July 9, 2006 by 5FM Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.