MySql 错误:1364 字段“display_name"没有默认值 [英] MySql Error: 1364 Field 'display_name' doesn't have default value
问题描述
我刚刚从 MAMP 安装切换到本机 Apache、MySql 和 PHP 安装.我已经让一切正常,但我已经开始在新环境中使用我的网络应用程序,突然任何 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屋!