Forums

Connecting MySQL database from external applications Error.

I am trying to connect to the database and there is an error. What should I do? I'm trying to use the database in an external application.

Error:

mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on 'dhruvsomani.mysql.pythonanywhere-services.com:3306' (10060 A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond)

Code:

connection = mysql.connector.connect(user='dhruvsomani', password='********',
                                    host='dhruvsomani.mysql.pythonanywhere-services.com',
                                    database='dhruvsomani$smsr')

What should I do?

Do you mean external to PythonAnywhere?

@jgmdavies Yes. From my desktop.

@jgmdavies So?

I think you need to use SSH tunnelling - try searching this Forum for 'tunnel', or maybe 'external mysql'?

HTH

Jim

@jgmdavies I looked it up and it seems that SSH tunneling is only for paid accounts.

Ah, sorry.

Unfortunately SSH tunnelling is the only way we support remote access to MySQL databases right now.