+
80
-

mysql插入空值出现 1366 - Incorrect integer value: '' for column

今天将程序从mysql5.7移植到mysql5.6后运行程序,出现

出现 1366 - Incorrect integer value: '' for column

mysql5.7的时候可以直接将空值自动转换为默认值,怎么5.6不支持,那怎么办?

网友回复

+
0
-

修改 my.ini 或my.cnf文件.

# Set the SQL mode to strict

sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”

改为:

# Set the SQL mode to strict sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
我知道答案,我要回答