我使用flask-migrate對mysql數(shù)據(jù)庫進(jìn)行遷移
python xxx.py db init 成功執(zhí)行
但是自動創(chuàng)建遷移腳本的時候不成功:python xxx.py db migrate -m “initial migration”
提示'str' does not support the buffer interface
為了能使mysql保存中文,我把character_set_database,character_set_server這兩個都改成了utf-8
我使用的是python3.4,百度了一下是因為編碼問題,那我該在哪個地方改呢?
是在寫入mysql的語句中對數(shù)據(jù)encode么?
剛學(xué)flask,求大神詳細(xì)解釋一下,感激不盡!
添加回答
舉報
0/150
提交
取消