我试图创建这些表:DATETIME默认值0 MYSQL 5.5.25
CREATE TABLE IF NOT EXISTS `qa_discountcoupons` (
`discount_code` INT NOT NULL AUTO_INCREMENT ,
`status_code` INT NOT NULL ,
`discount_date` DATETIME NOT NULL DEFAULT 0 ,
PRIMARY KEY (`discount_code`) ,
INDEX `discounts_to_status` (`status_code` ASC) ,
CONSTRAINT `discounts_to_status`
FOREIGN KEY (`status_code`)
REFERENCES `qa_status` (`status_code`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
,但我得到这个错误:
Error Code: 1067. Invalid default value for 'discount_date'
查看类似的问题 http://stackoverflow.com/questions/168736/how-do-you-set-a-default-value-for-a-mysql-datetime-column – PriestVallon