一.
1.在建表时没有设置ENGINE=InnoDB,所以表的ENGINE默认为MyISAM
2.当我修改了主表和从表的ENGINE都为InnoDB时,(alter table tbl_name ENGINE=InnoDB)但是show create table tbl_name \G时
没发现有CONSTRAINT `itcast_student_ibfk_1` FOREIGN KEY (`class_id`) REFERENCES `itcast_class` (`class_id`)
3.只有在新建的时主表和 从表都定义了ENGINE=InnoDB才会出现
CONSTRAINT `itcast_student_ibfk_1` FOREIGN KEY (`class_id`) REFERENCES `itcast_class` (`class_id`)