前几天帮一位朋友测试关联表的特性时,用
- Create TABLE `parts` (
- `part_id` smallint(6) NOT NULL ,
- `part_name` varchar(6) NOT NULL,
- `part_mail` varchar(50) NOT NULL,
- `part_pass` varchar(20) NOT NULL,
- PRIMARY KEY (`part_id`),
- FOREIGN KEY(part_name) REFERENCES books(book_borrower) )
- ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci;
明明创建表的SQL语句里已经指定ENGINE=InnoDB类型了,但MYSQL还是自动默认选择了MyISAM类型,一开始在苦思关闭 MySQL重启,删除库重建问题依旧,后来百度查到把MySQL的data目录下的ibdata1和ib_logfile1、ib_logfile0统统 删除,再重启问题解决了