环境介绍:
CentOS 6.7
数据库版本:MariaDB10.0.21
在删除一张有主键的表时,直接抛出错误“ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails”
解决办法:临时停止主键检查
MariaDB [d]> SET FOREIGN_KEY_CHECKS = 0;
MariaDB [d]> drop table actions;
MariaDB [d]> SET FOREIGN_KEY_CHECKS = 1;