Invalid default value for \'expire\' - CREATE TABLE `sessions`
MahdiIsComing opened this issue · comments
Hi
When Installing the new Demo server (by uncommenting some lines in index.php & open webpage to create tables), some people encounter this error:
Invalid default value for \'expire\' - CREATE TABLE `sessions` (
`id` mediumint(9) unsigned not null auto_increment NOT NULL,
`version` integer NOT NULL default 0,
`session_key` varchar(100) NOT NULL default \'\',
`session_data` longtext NOT NULL,
`expire` datetime NOT NULL default 0,
`tenant` mediumint(9) unsigned NOT NULL default 0,
PRIMARY KEY (`id`))ENGINE=InnoDB DEFAULT CHARSET=utf8;
What's the problem?
I found the solution, it is here:
The error is because of the sql mode which can be strict mode. You can check this by running:
SELECT @@GLOBAL.sql_mode global, @@SESSION.sql_mode session
And you can turn it off with the following command:
SET GLOBAL sql_mode = '';
More information at https://stackoverflow.com/q/36374335/1404793
Thanks @MahdiIsComing