Forums

How reach external MySQL from PAW ?

I'm trying to reach a MySQL server I have externally to PAW. I just enrolled a "Hacker" account that's supposed to get the ability to "Access to external internet sites from your code"

But when I try to connect to my external DB I got an error "mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on ...."

Everything works if I connect to my internal PAW MySQL server mysql.server but I got this error connecting to the external server.

My code works from my local PC so everything is OK with the connection string and so...

I tried both the module "mysql" and the "MySQLdb", same results. It seems PAW is blocking me...

Any hint?

You said you just upgraded your account. Go to the Web tab in your account dashboard and reload your webapp. Then log out of PythonAnywhere! and log back in to your account. Report back the results of trying your connection after those steps.

And WELCOME to PythonAnywhere!! We're glad to have you here...☺

Oh, I should have said that when an account is upgraded from a free account certain parts of your account configuration change, once that is all completed you should have smooth sailing...☺

Thank you very much, not it works like a charm.

I like PythonAnywhere. I like programming everywhere on the go with my iPad. Fabulous :-)))

I'm glad you got it fixed. I'm glad to report that it just keeps getting better here, so please join us in guiding the staff in what you want this place to be. They are quite responsive.

@a2j thanks :-)

For anyone else wondering what you need to do to enable new features when you upgrade your account -- processes that were running before you upgraded won't get the new features, but new processes will. So you don't need to log out, but you do need to reload your web apps and restart consoles.