我在localhost wamp MySQL服务器上使用这个架构,它工作正常:
CREATE TABLE `tblcustomers` (
`customerid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`customername` varchar(50) NOT NULL,
`customerphone` varchar(11) DEFAULT NULL,
`customeraddress` varchar(255) DEFAULT NULL,
`registrationdate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY `credid` (`customerid`),
UNIQUE KEY `credname` (`customername`),
UNIQUE KEY `customerid` (`customerid`)
) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=latin1;
MySQL说:文档
#1067 - Invalid default value for 'registrationdate'
当我在在线服务器上导入转储文件时,我收到上面的消息。怎么处理呢?
答案 0 :(得分:1)
将registrationdate
FROM DATETIME
的数据类型更改为TIMESTAMP
,您应该通过