Forums

Can't connect to MySQL server on 'paco020295.mysql.pythonanywhere-services.com' (10060)

I have seen many posts but i am finding no soluction. I am trying to connect from a django application. This is my DATABASES settings in settings.py

DATABASES =

'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'paco020295$franciscocv',
    'USER': 'paco020295',
    'PASSWORD': 'mypasswordhere',
    'HOST': 'paco020295.mysql.pythonanywhere-services.com',
}

Can anyone spot an error here? What else can i try?

This is the error:

django.db.utils.OperationalError: (2002, "Can't connect to MySQL server on 'paco020295.mysql.pythonanywhere-services.com' (10060)")

That all looks fine. Are you running your Django code inside PythonAnywhere? You won't be able to connect to the MySQL database from code running elsewhere.

What is the minimum account upgrade to allow connecting to the MySQL database from code running elsewhere (local) ?

$5 Hacker.

Hi. I'm using "Hacker" account but I can't connect to db and I have the same problem. Why?

Is it happening constantly or only intermittently?

This happens all the time with all applications and database programs.

Then it's likely that you've got some of the connection code wrong - https://help.pythonanywhere.com/pages/UsingMySQL

I'm trying to connect using mysqlclient but I get this problem "MySQLdb.OperationalError: (2002, "Can't connect to server on 'trendorders.mysql.pythonanywhere-services.com' (10060)")". What's wrong?

from MySQLdb import _mysql


db = _mysql.connect(host="trendorders.mysql.pythonanywhere-services.com",
                    user="trendorders",
                    password="password",
                    database="trendorders$piramid")

I see that you posted about this on another forum thread so will reply there.