Mysql ERROR 1067: Invalid default value for ‘date’ [How to Solve]

When adding fields to a table, I suddenly find that the default value of a field of date type is wrong, which is depressing~

After troubleshooting, it turns out that there is a problem with MySQL configuration. Under Wamp, SQL is not set in MySQL 5.7_ Mode.

1. Find [mysqld] in my.ini file

2. If there is no SQL_Mode, add it and modify it if necessary

sql_mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"
or
sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

3.Restart MySQL;
use the following commands to operate mysql:
systemctl restart mysqld.service
systemctl start mysqld.service
systemctl stop mysqld.service

Read More: