-- 移除外键约束 SET FOREIGN_KEY_CHECKS = 0; TRUNCATE table $table_name; -- 启用外键约束 SET FOREIGN_KEY_CHECKS = 1;