snomed-database-loader icon indicating copy to clipboard operation
snomed-database-loader copied to clipboard

MySQL Datetime no longer accept '0000-00-00 00:00:00' as default value

Open philipskokoh opened this issue 6 years ago • 2 comments

11:15:15 CREATE TABLE sct2_concept ( id BIGINT NOT NULL DEFAULT 0, effectiveTime DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', active TINYINT NOT NULL DEFAULT 0, moduleId BIGINT NOT NULL DEFAULT 0, definitionStatusId BIGINT NOT NULL DEFAULT 0, supersededTime DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (id,effectiveTime)) ENGINE=MyISAM DEFAULT CHARSET=utf8; Error Code: 1067. Invalid default value for 'effectiveTime' 0.0023 sec

Quoted from https://dev.mysql.com/doc/refman/5.7/en/datetime.html

The DATETIME type is used for values that contain both date and time parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.

At the moment, I just replaced all '0000-00-00 00:00:00' to '1000-01-01 00:00:00'

philipskokoh avatar Mar 14 '18 03:03 philipskokoh

disable sql_mode No Zero in Date

thieuanh1995hn avatar Oct 08 '19 08:10 thieuanh1995hn

disabling sql_mode No Zero in Date is still not working, any other solution please?

iqra-appifytech avatar Jan 17 '20 05:01 iqra-appifytech