并没有设置严格模式,怎么还是输入0000-00-00,而不是显示输入的无效日期? mysql> show variables like 'sql_mode'; +---------------+---------------------+ | Variable_name | Value | +---------------+---------------------+ | sql_mode | ALLOW_INVALID_DATES | +---------------+---------------------+ 1 row in set (0.00 sec) mysql> select * from date1; Empty set (0.00 sec) mysql> insert into date1 values ('2001-13-40'); Query OK, 1 row affected, 1 warning (0.00 sec) mysql> show warnings; +---------+------+--------------------------------------------+ | Level | Code | Message | +---------+------+--------------------------------------------+ | Warning | 1265 | Data truncated for column 'date1' at row 1 | +---------+------+--------------------------------------------+ 1 row in set (0.00 sec) mysql> select * from date1; +------------+ | date1 | +------------+ | 0000-00-00 | +------------+ 1 row in set (0.00 sec) |
合作电话:010-64087828
社区邮箱:greatsql@greatdb.com