MySQL SELECT list is not in...MySQL关闭严格模式

SELECT list is not inGROUP BY clause and contains nonaggregated column
MySQL严格模式主要用以下场景

  • 不支持对not null字段插入null值
  • 不支持对自增长字段插入”值
  • 不支持text字段有默认值

我们用不到时可以关闭它,在Laravel中可以编辑database.php,关闭严格模式,不使用框架时,可以编辑my.ini
在[mysqld]加一行

[mysqld]
sql-mode=""

重启MySQL,就关闭了

原文地址:https://www.cnblogs.com/cxfs/p/13694139.html