mysql建表errno:150
CREATE TABLE `product_card` (
`ID` VARCHAR(32) COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
`CARD_NO` VARCHAR(20) COLLATE latin1_swedish_ci DEFAULT NULL,
`CARD_PWD` VARCHAR(50) COLLATE latin1_swedish_ci DEFAULT NULL,
`STATUS` VARCHAR(2) COLLATE latin1_swedish_ci DEFAULT NULL,
`money` INTEGER(11) DEFAULT NULL,
`product_id` VARCHAR(32) COLLATE utf8_general_ci DEFAULT NULL,
`createDate` DATETIME DEFAULT NULL,
`modifyDate` DATETIME DEFAULT NULL,
`PRICE` DECIMAL(15,5) DEFAULT NULL,
`ORDER_ID` VARCHAR(32) COLLATE
utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`ID`),
KEY `FK60163F61F4E7D111` (`product_id`),
KEY `FK32425F4E7D345341` (`ORDER_ID`),
CONSTRAINT `FK60163F61F4E7D111` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`),
CONSTRAINT `FK32425F4E7D345341` FOREIGN KEY (`ORDER_ID`) REFERENCES `orders` (`id`)
)ENGINE=
InnoDB DEFAULT CHARSET=utf8;
出现这种错误一定要注意红色字体所表,外建所在字段字符编码与参引表的字符编码相同