mysql 22007_MySQL数据库SQLSTATE[22007]: Invalid datetime format 日期类型不能为空值的解决办法...
SQLSTATE[22007]:Invaliddatetimeformat:1292Incorrectdatetimevalue:''forcolumn'xxx'atrow1mysql5.7datetime默认值为‘0000-00-0000:00:00'值无法创建问题解决mysql5.7报错thisisincompatiblewithsql_mode=on...
·
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '' for column 'xxx' at row 1
mysql5.7 datetime 默认值为‘0000-00-00 00:00:00'值无法创建问题解决
mysql5.7报错this is incompatible with sql_mode=only_full_group_by
select @@sql_mode;
解决办法:
不要加STRICT_TRANS_TABLES
执行如下命令即可
set @@global.sql_mode ='ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
后来我直接在添加和更新的时候,增加了日期赋值,一劳永逸,不用考虑mysql环境了就$Content->create_time = date("Y-m-d H:i:s", time());
$Content->update_time = date("Y-m-d H:i:s", time());
更多推荐
所有评论(0)