
为了正在 MySQL 表的列外存储像“0000-00-00”如许的日期,咱们必需将 SQL 模式配置为“allow_invalid_date”。上面的例子将演示它 -
mysql> SET sql_mode = 'allow_invalid_dates'; Query OK, 0 rows affected, 1 warning (0.03 sec) mysql> Create table test_date(date_order date); Query OK, 0 rows affected (0.45 sec) mysql> Insert into test_date(date_order) values('0000-00-00'); Query OK, 1 row affected (0.04 sec) mysql> Select * from test_date; +------------+ | date_order | +------------+ | 0000-00-00 | +------------+ 1 row in set (0.00 sec)
登录后复造
以上等于若是正在 MySQL 外将“0000-00-00”存储为日期?的具体形式,更多请存眷萤水红IT仄台另外相闭文章!

发表评论 取消回复