Forums

Remote MySQL

Is it possible to remotely connect to the PA MySQL server? If so, what's the hostname/IP?

Thanks!

Hi there, the MySQL server is currently only available from within PythonAnywhere I'm afraid... Since you have a paying account though, you could probably set up some kind of clever SSH tunnel?

like this... https://www.pythonanywhere.com/forums/topic/437/

+1 for paid accounts...☺

Beforehand, I have no idea how to make a SSH tunnel. I'll try what's explained in this link though! Thanks!

@leisergeist: Working from SSH is truly awesome. IMO it's worth the learning curve. Once you get it working, be sure to setup a key so you won't have to type your id or password on log-on.

enjoy!!

The only thing to remember is that your local SSH instance is forwarding to the remote server you want to contact, so you always end up connecting to localhost your end and relying on SSH to do the forwarding. This should work on pretty much any platform, including Windows, but if you have any problems them post them here and we can do our best to help. It's a little confusing at first, but you'll get the hang of it.

The only time it can cause problems is in cases where the hostname is also sent as part of the protocol - for example, HTTP sends a Host header which will then contain localhost instead of the domain you're trying to access, and this can cause the request to fail in some cases. However, for MySQL this shouldn't be an issue, I don't think.