Mysql – Accessing MySQL server via VPN in python

MySQLpythonvpn

Hi I have a MySQL server that I need access through a VPN.

I use MySQLdb package to access MySQL server in Python.

When I can access the server without VPN, it works fine, but when I'm at certain locations, I need to connect through VPN.

My computer is connected to the VPN and I can access the database through PHPMyAdmin, but MySQLdb gives me an error message:
OperationalError: (2003, "Can't connect to MySQL server on 'MY_IP' (10061)")

Any ideas on why it's not working?
Thanks

Best Answer

PHPMyAdmin is a web application, which your VPN probably lets by with ease (TCP port 80 or https on 443). Your VPN probably isn't letting the MySQL port though (TCP 3306, if it is the default).

Good luck,

--jed