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.
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.