ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constrain fails。
It may be that MySQL has set a foreign key association in InnoDB, making it impossible to update or delete data. This can be avoided by setting the FOREIGN_KEY_CHECKS variable.
1、set foreign_key_checks=0;
2. Delete the table to be deleted;
3、set foreign_key_checks=1;