ERROR 1292 (22007): Incorrect datetime value: '0000-00-00 00:00:00'
mysql允许将’0000-00-00’保存为“伪日期”,如果不使用no_zero_date sql模式。
使用下面mysql 查询
show variables like 'sql_mode';
结果:
+---------------+------------------------------------------------------------------------------------------------------------------------------------+
| variable_name | value |
+---------------+------------------------------------------------------------------------------------------------------------------------------------+
| sql_mode | strict_trans_tables,no_zero_in_date,no_zero_date,error_for_division_by_zero,no_auto_create_user,no_engine_substitution |
---------------------
参数中含有: no_zero_date
解决办法: 去掉 no_zero_date
set global sql_mode='strict_trans_tables,no_zero_in_date,error_for_division_by_zero,no_auto_create_user,no_engine_substitution';
---------------------
mysql出现ERROR : (2006, 'MySQL server has gone away')
修改参数:
mysql> set global max_allowed_packet=1024*1024*16;
博客原文:https://blog.csdn.net/zhengwei125/article/details/79003563/