Forums

tuxfux.mysql.pythonanywhere-services.com resolving issues

All,

I tried hosting my webpages on tuxfux.pythonanywhere.com . I used the default mysql entries from pythonanywhere site.

 DATABASES = {

# development
# 'default': {
#     'ENGINE': 'django.db.backends.sqlite3',
#     'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }

# ##  production
'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME':'tuxfux$batch206',
        'USER':'tuxfux',
        'PASSWORD':'root',
        'HOST': 'tuxfux.mysql.pythonanywhere-services.com',
        'PORT':'' # 3306

}

}

when i am doing "python manage.py migrate" i am getting the following errors.

     File "/home/tuxfux/myenv/local/lib/python2.7/site-packages/MySQLdb/__init__.py", line 86, in Connect
     return Connection(*args, **kwargs)
     File "/home/tuxfux/myenv/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 204, in __init__
     super(Connection, self).__init__(*args, **kwargs2)
    django.db.utils.OperationalError: (1045, "Access denied for user 'tuxfux'@'10.0.0.212' (using password: YES)")

On doing nslookup on tuxfux.mysql.pythonanywhere-services.com i found out this is resolving to a different ip - 10.0.0.115

      (myenv) 02:48 ~/src $ nslookup tuxfux.mysql.pythonanywhere-services.com
     Server:         127.0.0.1
     Address:        127.0.0.1#53
     Non-authoritative answer:
     tuxfux.mysql.pythonanywhere-services.com        canonical name = users-mysql-5.machines.pythonanywhere-

services.com. users-mysql-5.machines.pythonanywhere-services.com canonical name = live-users-db-5.clt1czfvlzlc.us-east-1.rds.amazonaws.com. live-users-db-5.clt1czfvlzlc.us-east-1.rds.amazonaws.com canonical name = ec2-52-202-199-231.compute-1.amazonaws.com. Name: ec2-52-202-199-231.compute-1.amazonaws.com Address: 10.0.0.155

On further changing my setting file DATABASE to the ip - 10.0.0.115 its giving a syntax error.

__import__(name)

File "/home/tuxfux/src/mysite/settings/init.py", line 1, in <module> from .base import * File "/home/tuxfux/src/mysite/settings/base.py", line 105 'HOST':10.0.0.155, ^ SyntaxError: invalid syntax

can anyone please provide me some insite on this.

If that is your actual password then anyone on PythonAnywhere would be able to access your database. You should change you mysql password.

You would probably have to put the 10.0.0.155 in quotes.

That sounds like there was some weird dns caching issue. I see that you signed up a long time ago- did you by any chance delete/recreate your mysql database recently? That perhaps moved your database to a new db server (which we do behind the scenes by flipping where your tuxfux.mysql.pythonanywhere-services.com points to to a new IP). And then if your webapp was continuously running, then maybe it got was still remembering and using the old IP?