MySql错误:1364字段"display_name"没有默认值 [英] MySql Error: 1364 Field 'display_name' doesn't have default value
问题描述
我刚刚从MAMP安装切换到本机Apache,MySql和PHP安装.我一切正常,但是我已经开始在新环境中使用Web应用程序,突然任何INSERT命令都会导致以下错误:
I have just switched from a MAMP installation to a native Apache, MySql and PHP installation. I have got everything working, but I have started using my web app in the new environment and suddenly any INSERT commands are resulting in the following error:
SQLSTATE [HY000]:常规错误:1364字段'display_name'没有默认值
SQLSTATE[HY000]: General error: 1364 Field 'display_name' doesn't have a default value
看来我现在无法将字段留空.我正在使用MySql版本5.6.13
It seems the I am unable to leave a field blank now where I was able to before. I am using MySql version 5.6.13
有没有办法在MySql中更改此设置?
Is there a way to change this setting in MySql?
推荐答案
MySQL最有可能处于STRICT模式.
MySQL is most likely in STRICT mode.
尝试运行SET GLOBAL sql_mode=''
或编辑my.cnf,以确保未设置STRICT_ALL_TABLES
等.
Try running SET GLOBAL sql_mode=''
or edit your my.cnf to make sure you aren't setting STRICT_ALL_TABLES
or the like.
这篇关于MySql错误:1364字段"display_name"没有默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!