Jump to content

Mysql Database Remote Connection


5FM

Recommended Posts

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???

 

:clapping:

Link to comment
Share on other sites

Welcome to the forums, 5FM! :clapping:

 

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. :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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);

?>

 

 

 

 

:)

Link to comment
Share on other sites

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 by 5FM
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...