Reputation: 112
I recently tried to migrate a flask site using a SQLite db connected to using SQLalchemy. I am migrating to Pythonanywhere and I want to change to a mySQl db. I used this code to connect to the db:
mysql+mysqldb://USERNAME:[email protected]/news
obviously I replace USERNAME and PASSWORD with the necessary values. I get this error:
sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1044, "Access denied for user 'USERNAME'@'%' to database 'news'") (Background on this error at: http://sqlalche.me/e/e3q8)
please help, I'm not sure what to do at this point. Thank you
Upvotes: 0
Views: 660
Reputation: 876
Been playing around with my own account on Pythonanywhere and figured it out. The database name is username$dbname
so your connection string should be:
mysql+mysqldb://USERNAME:[email protected]/USERNAME$news
Upvotes: 4