Forums

"Can't connect to MySQL server on 'ntucker1.mysql.pythonanywhere-services.com'" - trouble connecting to MySQL server

I've tried various python modules to connect to the provided MySQL server, but none seem to work - all throw a variation of this error message. Am I referring to the host address incorrectly?

That looks like the right DNS name for your databases. Are you using the correct database name? Can you start a console connected to the database (There's a link for each database on the Databases tab)

One other possibility -- are you trying to connect from code that's running inside PythonAnywhere? Or from code outside?

If it's the latter, you'll need to set up an SSH tunnel (our MySQL instances aren't reachable from the broader Internet for security reasons). There's help on setting up an SSH tunnel here.