Forums

Issues connecting to MySql

Hello, I'm trying to set up a new Django project and I'm having issues connecting to the database. I had it working previously but I'm trying to set it up with env variables, and it seems like something got messed up. I've tried everything I can see on these forums and Stack Overflow, but no luck. Pretty much anything I try to do throws a (1044, "Access denied for user 'burhoo'@'%' to database 'budget_about_it'")

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'burhoo$budget_about_it',
        'USER': 'burhoo',
        'PASSWORD': 'mypassword',
        'HOST': 'localhost',
        'PORT': '3306',
        'OPTIONS': {
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"
        }
    }
}

I've ensured that the password is correct (the one set on the db page), but something is still clearly not set up correctly. I get this same error if I try to run migrations, mess around in the sql console, etc. Please help!

Have a look at this help page -- HOST should be your mysql hostname (it's shown on your Databases page as "Database host address"), not localhost.