Forums

error connecting to mysql database

I am trying to connect to a MySQL database for my flask app with SQLAlchemy. I know I'm missing something stupid here, but am at my wit's end trying to figure out what. I set

SQLALCHEMY_DATABASE_URI="mysql+mysqlconnector://dbenkeser:mypassword@dbenkeser.mysql.pythonanywhere-services.com/dbenkeser:mydatabasename"

But I keep getting an error

Access denied for user 'dbenkeser'@'%' to database 'dbenkeser:mydatabasename'

I remember going through this problem when I initially set up my data base, but am an idiot and didn't document what I did.

Oh God, I'm so dumb

SQLALCHEMY_DATABASE_URI="mysql+mysqlconnector://dbenkeser:mypassword@dbenkeser.mysql.pythonanywhere-services.com/dbenkeser$mydatabasename"

Note that $ in the data base name. Will leave this up for posterity.

Glad you figured that out! :)