问题
truncate xx
时,提示cannot truncate a table refrenenced in a foreign key constraint
解决
You can do truncate by skipping foreign key checks.
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE table1;
SET FOREIGN_KEY_CHECKS = 1;
truncate xx
时,提示cannot truncate a table refrenenced in a foreign key constraint
You can do truncate by skipping foreign key checks.
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE table1;
SET FOREIGN_KEY_CHECKS = 1;