I can't run python manage.ph migrations from bach console. whatever I try it always raises this host issue:

File "/home/XYZ/.virtualenvs/msgl/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 227, in get_new_connection return Database.connect( conn_params) File "/home/XYZ/.virtualenvs/msgl/lib/python3.7/site-packages/MySQLdb/ init .py", line 85, in Connect return Connection(*args, kwargs) File "/home/XYZ/.virtualenvs/msgl/lib/python3.7/site-packages/MySQLdb/connections.py", line 204, in init super(Connection, self). init ( args, *kwargs2) django.db.utils.OperationalError: (2003, "Can't connect to MySQL server on 'XYZ.mysql.pythonanywhere-services.com' (110)")

Thanks for your support in advance. Sezen E.

I think so, This is what I have in my databases tab (I just replaced my user name with XYZ):

MySQL settings Connecting:

Use these settings in your web applications. Database host address: XYZ.mysql.pythonanywhere-services.com

Should I use something else?

thanks Sezen

thanks for the response Glenn.

Here is what I have in database settings, which looks good to me:

DATABASES = {

'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'xyz$abcdb',
    'USER':'xyz',
    'PASSWORD':'abcpassword',
    'HOST':'xyz.mysql.pythonanywhere-services.com',
    'PORT':'5432',

Why would it complain that it cannot connect to the database: 2003, "Can't connect to MySQL server on 'XYZ.mysql.pythonanywhere-services.com' (110)")

Is it physical access issue, I mean in networking layer or is it credentials issue preventing django to login to the database?

I can login to the database through the console successfully:

mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | xyz$default | | xyz$abcdb | +--------------------+ 3 rows in set (1.97 sec) mysql>

Thanks again in advance for your support.

thanks glenn good catch, I had overlooked the port when I changed it from postgreSQL to mySQL. It works well after updating the port.

Thanks

os.environ['DJANGO_SETTINGS_MODULE']= 'myproject.settings'

from django.core.wsgi import get_wsgi_application

application = get_wsgi_application()

what is the error in this i can't understand here this code is used in wsgi.py fileand the error is syntax error in if class

Sorry, we have had to rate-limit your feedback sending.
Please try again in a few moments... Thanks for the feedback! Our tireless devs will get back to you soon.