我嘗試刪除表之前,我有這個問題QUESTION錯誤1005無法創建表
,併成功地解決了,但現在我想刪除表,我得到這個錯誤:
ERROR: Error 1005: Can't create table 'radiotaxi_final.#sql-108_28' (errno: 150)
聲明:
ALTER TABLE `RadioTaxi_Final`.`DireccionConductor` CHANGE COLUMN `Conductor_cedula` `Conductor_cedula` INT(11) NOT NULL ,
ADD CONSTRAINT `fk_DireccionConductor_Conductor1`
FOREIGN KEY (`Conductor_cedula`)
REFERENCES `RadioTaxi_Final`.`Conductor` (`cedula`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
結果:
SQL script execution finished: statements: 11 succeeded, 1 failed
表:
CREATE TABLE `conductor` ( `cedula` int(10) unsigned NOT NULL, `apellidos` varchar(30) COLLATE utf8_spanish2_ci NOT NULL, `nombres` varchar(30) COLLATE utf8_spanish2_ci NOT NULL, `fechaNacimiento` date NOT NULL, PRIMARY KEY (`cedula`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci
150是外鍵創建錯誤。請張貼'RadioTaxi_Final.Conductor'表。 – 2013-03-04 14:55:13