Solved

Accessing MySQL database on another domain.

Posted on 2011-09-29
5
549 Views
Last Modified: 2013-11-13
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
Comment
Question by:Gary Fuqua, CISSP
  • 3
  • 2
5 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36819113
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
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36819147
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
 
LVL 3

Author Comment

by:Gary Fuqua, CISSP
ID: 36820828
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
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 36823881
I just called them and they said they block access to external databases.
0
 
LVL 3

Author Comment

by:Gary Fuqua, CISSP
ID: 36827098
GoDaddy confirmed.   They do not allow connections to external databases from the shared hosting environments.      
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question