1

ERROR 1067 (42000) at line 25: Invalid default value for 'created_on'

I'm getting this error while restoring a table after taking the dump(remotely). I have used

 mysqldump -h (hostname) -u -p (dbname) (tablename) > dump.sql 

and restored using

 mysql -u -p (dbname) < dump.sql.

Thank-you.

  • What is your sql_mode? Please check your current sql_modes by command: show variables like 'sql_mode' ; – CR241 Dec 14 '18 at 22:36
0

Please check your current sql_modes by command:

show variables like 'sql_mode' ; 

Or

You can include SET statement, before you run any statements put this in the first line:

SET sql_mode = '';

Problem might be because of sql_modes.

So change it by remove the sql_mode "NO_ZERO_IN_DATE,NO_ZERO_DATE" to make it work.

This is the default sql_mode in mysql new versions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.