Solved

Accessing MySQL database on another domain.

Posted on 2011-09-29
5
562 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.

739 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