Forums

OperationalError at / (1044, "Access denied for user 'saishivab'@'%' to database 'saishivab$saishivab$kardb'")

Hi I have followed the instructions in the link https://help.pythonanywhere.com/pages/UsingMySQL/ but I still get the '1044, "Access denied for user' error.

Here is the code in my settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'saishivab$saishivab$kardb',
        'USER': 'saishivab',
        'PASSWORD': '',
        'HOST': 'saishivab.mysql.pythonanywhere-services.com',
    }
}

I used the same variables and password in the below command in the bash console, and the connection could be established.

mysql -u USERNAME -h HOSTNAME -p 'USERNAME$DATABASENAME'

I also tried an other variation of NAME by having saishivab$kardb, and I got 'ProgrammingError at / (1146, "Table 'saishivab$kardb.django_session' doesn't exist")'

Pls help

Thanks

the name should be saishivab$kardb instead of saishivab$saishivab$kardb

re: the django database-- perhaps you needed to create / migrate the database first?

Thanks of the help. The problem is resolved.

OK -- glad we could help!