数据库
首页 > 数据库> > sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1091, "Can't DROP 'users_i

sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1091, "Can't DROP 'users_i

作者:互联网

 

flask 迁移数据库报错

报错:

sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1091, "Can't DROP 'users_ibfk_1'; check that column/key exists")
[SQL: ALTER TABLE users DROP FOREIGN KEY users_ibfk_1]

解决办法:

将每个数据库表类型InnoDB转为 MyISAM

 

如果报错ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constrain fails。

需要删除每个表的外键限制

如果需要表类型InnoDB,迁移完在转回去

标签:users,ibfk,InternalError,DROP,报错,key
来源: https://www.cnblogs.com/zhaolinag/p/11709188.html