Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 583
  • Last Modified:

Accessing MySQL database on another domain.

Here are my circumstances:

I have a website  called www.website1.com

I have scripts that access a MySQL database on the same domain.

I have a website called www.website2.com

I scripts to access a  MySQL database on the same domain.

All of the above works.

I need to access the MySQL database on website2 using a script on website1.

Website 1 is hosted on GoDaddy
Website 2 is hosted in my office.    

For some reason, the connect script, doesn't connect if I use known working credentials.   I tried it from several different hosting accounts with GoDaddy.  

Any suggestions on how to debug this.     Here are the error message my test connection code throws up.

Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 110 in /home/content/w/b/l/wblocal2008/html/database/testconn.php on line 77
Could not connect to the server 'xxxxxxxxxxxx.no-ip.info'

Lost connection to MySQL server at 'reading initial communication packet', system error: 110
Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/w/b/l/wblocal2008/html/database/testconn.php on line 98

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/content/w/b/l/wblocal2008/html/database/testconn.php on line 98
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)


0
Gary Fuqua, CISSP
Asked:
Gary Fuqua, CISSP
  • 3
  • 2
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
Have you checked to see if access on port 3306 for MySQL is allowed thru your ISP?  Also, firewalls will generally block external requests unless you have expressly allowed them.  You can check to see if port 3306 is blocked by going to https://www.grc.com/x/ne.dll?bh0bkyd2 and use the "Lookup Specific Port Information" button to check it.   Also check your firewall to see if port 3306 is allowed Inbound.

If both those things are allowed and you still can't access your home server, then Godaddy may be blocking it.  Another questioner moved to another hosting service because he couldn't access his MS SQL database elsewhere.
0
 
Dave BaldwinFixer of ProblemsCommented:
I just tried to access a MySQL installation on one of my Linux hosts from my Godaddy host and it won't connect.  I connect to it all the time from home so I know remote access is not blocked on the Linux host.
0
 
Gary Fuqua, CISSPOwnerAuthor Commented:
Thanks for going through the effort Dave.   I have come to a similar impasse.   I think it might be GoDaddy.     I will make the call to GoDaddy and post the results.  
0
 
Dave BaldwinFixer of ProblemsCommented:
I just called them and they said they block access to external databases.
0
 
Gary Fuqua, CISSPOwnerAuthor Commented:
GoDaddy confirmed.   They do not allow connections to external databases from the shared hosting environments.      
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now