[ERROR] Sửa lỗi #1067 - Invalid default value for 'post_date' (ok)

https://stackoverflow.com/questions/36882149/error-1067-42000-invalid-default-value-for-created-at

Liên quan: https://app.gitbook.com/o/-Ld-T-YrshK3K0ZdDqFk/s/-LkEflK7omUH0BiE36IM/c/CdQgXUfpjLQ8J0SiYp3r/

show variables like 'sql_mode' ;

And 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.

You can set sql_mode globally as root by command:

set global sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';

Last updated