I designed a database model on MySQLWorkbench. Then, I export the model to generate a SQL script. Finally, when I import it in MariaDB PhpMyAdmin it raises errors like :
#1067 – Invalid default value for ‘created’
MariaDB version : 10.5.4
Do you have any idea?
2
Answers
Here is my solution:
create DATETIME NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
MySQL refused the date to be like this: 0000-00-00 00:00:00
I know this is old, but just ran into this, appears Maria 10.5 won’t accept invalid inserts even when ALLOW_INVALID_DATES is set in SQL mode, 10.3 would. I cannot find any reference of this in the documentation, but I can insert invalid dates in 10.3 and cannot in 10.5 on several server I’ve tested on. Dealing with this in an upgrade from 10.3 on a large database and regardless of whether allowing nulls is a good practice, it’s broken a massive application as a result and we’re bailing back to 10.3.