Solved

Accessing MySQL database on another domain.

Posted on 2011-09-29
5
546 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Report events not being triggered 8 115
scoreUp challenge 14 57
My project did see openJDK that I installed. What could be the problem 7 123
stringclean challenge 26 71
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

895 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now