This MySql query runs fine in Windows:
CREATE TABLE `posts`.`table` (
`idTable` INT NOT NULL AUTO_INCREMENT,
`Column1` DATETIME NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`idTable`));
In Ubuntu, it is giving the following error:
ERROR 1067: Invalid default value for
'Column1'
How do I give CURRENT_TIMESTAMP as the default value for 'Column1' in Ubuntu?
The version of MySql is this:
mysql Ver 14.14 Distrib 5.5.43, for debian-linux-gnu (x86_64) using readline 6.3
select @@version;show in both (Windows and Linux)? I think the option forDEFAULT CURRENT_TIMESTAMPfordatetimecolumns was added in 5.6 version. Your Linux installation has probably an older version.