Hello,
I am trying to enter the following default value and I get as return error code: the default timestamp is not valid.
`registered_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
What I have tried:
I have then changed to
'2013-06-23 05:09:12'
which is an old date time and this works. This could tell me the user is not registered yet.
But it would be nice to get it cleaner with the
'0000-00-00 00:00:00'
af tried above.
I have found this command:
mysql> SELECT @@sql_mode;
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@sql_mode |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
where I think these two keywords:
NO_ZERO_IN_DATE,NO_ZERO_DATE
are the issue.
Is there a way to get rid of it ? or do I have to use a different approach ?
Does somebody have an idea ?
Thanks.