1.看手册

The DATE type is used for values with a date part but no time part. MySQL retrieves and displays DATE values in 'YYYY-MM-DD' format. The supported range is '1000-01-01' to '9999-12-31'.

 

改成 '1000-01-01''9999-12-31'. 之间即可

 

2.还有种方式就是改mysql模式

修改my.cnf文件,在[mysqld]中添加

sql-mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

重启mysql

 

推荐第一种

Comments are closed.

Post Navigation