使用Flask-migrate 执行数据库迁移命令 遇见的坑
- 出现错误 Warning: (1366, “Incorrect string value: ‘\xD6\xD0\xB9\xFA\xB1\xEA…’ for column ‘VARIABLE_VALUE’ at row 479”)
决绝方法安装MySQL驱动 :
pip3 install mysql-connector-python
#更改配置
SQLALCHEMY_DATABASE_URI = 'mysql+mysqlconnector://root:@localhost:3306/flaskrbac?charset=utf8'
执行迁db upgrade 的时候数据中没有数据库表生成
解决方法步骤:
pip3 install Flask-Migrate #首先是安装
app = Flask(__name__)
db = Sqlalchemy(app)
migrate = Migrate(app)
manager = Manager(a