我是新来的,并试图上传一个sql转储文件,该文件在我的本地机器上运行得很好,可以放到云9中。但是在导入文件时,我得到了这个错误。
错误1067 (42000):“date_time”的默认值无效
转储文件中产生此错误的sql命令是
--
-- Table structure for table `history`
--
CREATE TABLE `history` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`action` varchar(4) NOT NULL,
`symbol` varchar(20) NOT NULL,
`company` varchar(255) NOT NULL,
`shares` int(11) NOT NULL,
`price` decimal(65,4) NOT NULL,
`total` decimal(65,4) NOT NULL,
`date_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `history`
--如能提供任何帮助,将不胜感激。
发布于 2018-04-17 11:59:14
不能在更新时使用CURRENT_TIMESTAMP。相反,将其更改为时间戳。
https://stackoverflow.com/questions/49877453
复制相似问题