数据库版本: 5.6.16
?
?操作系统: Red Hat Enterprise Linux Server release 6.3 (Santiago)
?
?在插入数据的时候提示告警:
?mysql> show warnings;
+---------+------+----------------------------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------------------------+
| Warning | 1366 | Incorrect integer value: ‘‘ for column ‘RegNum‘ at row 1 |
| Warning | 1366 | Incorrect integer value: ‘‘ for column ‘Hour‘ at row 1 |
+---------+------+----------------------------------------------------------+
?
?插入的其中一个字段类型为int,插入的空值为‘‘,应该改SQL为null,否则数据库里显示的内容为0 或者修改配置文件并重启:
?sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION",
将其修改为sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION",重启mysql后即可
??
Incorrect integer value: '' for column 'RegNum' at row 1