简体   繁体   中英

Changing database sqlite to mysql in Flask

I'm studying Flask Python and the tutorial that I'm following is: Tutorial Flask Python But the tutorial is using SQLite and I want change to MySql, so I not altered nothing and the url I set like mysql+pymysql://root:@localhost/miradi But I'm receving this erro:

sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1054, "Unknown column 'user.username' in 'field list'") [SQL: 'SELECT user.id AS user_id, user.username AS user_username, user.email AS user_email, user.image_file AS user_image_file, user.password AS user_password \nFROM user \nWHERE user.email = %(email_1)s \n LIMIT %(param_1)s'] [parameters: {'email_1': 'diogo@3ia.com.br', 'param_1': 1}] (Background on this error at: http://sqlalche.me/e/2j85)

What is doing?

SOLVED! Was the column name with mistakes. I love this framework because to change the database is very easy, just alter the url, cool.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM