1

I have a remote server running MySQL, with a LAMP server in the same location. The LAMP server can connect to the MySQL server (over the local network) with no problem, most of the time.

I also have a VPN server on the MySQL box (only way I can get a static IP for my home connection). I can connect to the VPN just fine, and browse the web through it, SSH through it, etc.

However, when I connect to my VPN server, PHP can no longer connect to the MySQL server. Once I disconnect, PHP can connect to the MySQL server again.

I'm not even sure where to start fiddling to fix this. Is this a VPN problem? A firewall problem? A problem with Apache? It smells like a VPN problem, as it goes away when I disconnect, but I can't find any indication why this should happen when I connect to the VPN.

1 Answer 1

0

Your VPN connection affects routing so your system cannot access local network anymore. The very simple way for your case IMO - add a static route to your MySQL server.

2
  • Thanks Sergey. I'm not sure I understand. The static route should be added to the MySQL server, or should be a route to the MySQL server?
    – Dave Child
    Mar 12, 2014 at 15:15
  • If the IP addresses are different then routing isn't the problem it's the forwarding on the remote system. An iptables rule to capture the traffic at the vpn server and redirect it to localhost might be more appropriate - however mysql authentication can be tied to IP addresses and may need updated.
    – symcbean
    Mar 12, 2014 at 17:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .