I got this problem, let's see if some one here can give me a hand with it.

I got a website hosted in a computer, with its own database, and I can access it from any computer using the domain pointing to it or its public address.

Using PHP I'm running a little script (on my website) that connects to another database and brings some information; the thing is that this other database is hosted in a computer within a VPN (using Hamachi) where the client doesn't have access but the server does.

If I connect from the server using

Mysql -h (IP_ADDRESS_ON_THE_VPN) -u user -p

It connects perfectly, so no firewall problem / connection problem.

But if I open the PHP script from a client, it says:

"SQLSTATE[HY000] [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. "

in other words: timeout...

Another test I made is connect the client to the VPN, and that way works perfectly!, strage... doesn't PHP run on the server? What't the best approach here?

Thanks for you time.

share|improve this question
    
So connecting from the server it's not the issue...look, you need to create an user for the client machine...first you need to get the ip of your client machine and create an user on your server for that ip – Hackerman 16 mins ago
    
can you post some of the PHP code that is establishing the connection that returns the error? – Martin Cup 11 mins ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.