简体   繁体   English

Mysql DDL在本地Wamp上有效,但不能在在线服务器上导入

[英]Mysql DDL works on local wamp but does not import on online server

I am using this schema on localhost wamp MySQL server and it works fine: 我在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 said: Documentation MySQL说:文档

#1067 - Invalid default value for 'registrationdate' 

When I import the dump file on online server I get the message above. 当我在联机服务器上导入转储文件时,会收到上述消息。 How to deal with it? 怎么处理呢?

registrationdate数据类型从DATETIME更改为TIMESTAMP ,您应该通过

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM