一、报错:
Cannot delete or update a parent row: a foreign key constraint fails (`salarycode`.`sys_role_user`, CONSTRAINT `sys_role_user_ibfk_2` FOREIGN KEY (`uid`) REFERENCES `sys_user` (`id`))
二、解决方法:
1、关闭外键约束
SET FOREIGN_KEY_CHECKS=0;
2、执行删除语句(以下是删除用户类型为32的数据)
delete from sys_user where type=32
3、删除完成后,重新开启外键约束
SET FOREIGN_KEY_CHECKS=1;