mysql问题解决SELECT list is not in GROUP BY clause and contains nonaggregated column
今天在Ubuntu下的部署项目,发现一些好好的列表页面发生
1055:Expression #11 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ppm_c.ppm_flow_starting_dealing.status' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
查了下问题出现的原因:
MySQL 5.7.5及以上功能依赖检测功能。
如果启用了ONLY_FULL_GROUP_BY SQL模式(默认情况下),MySQL将拒绝选择列表,HAVING条件或ORDER BY列表的查询引用在GROUP BY子句中既未命名的非集合列,也不在功能上依赖于它们。
(5.7.5之前,MySQL没有检测到功能依赖关系,默认情况下不启用ONLY_FULL_GROUP_BY。有关5.7.5之前的行为的说明,请参见“MySQL 5.6参考手册”。)
解决方法:
1.临时修改
查询
select @@global.sql_mode

重新设置值
set @@global.sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
这种方式mysql服务重启后就失效了
2.永久解决
修改配置文件
我的配置文件是/etc/mysql/mysql.conf.d/mysqld.cnf
在[mysqld]下面添加
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
重启mysql
问题解决
mysql问题解决SELECT list is not in GROUP BY clause and contains nonaggregated column的更多相关文章
- mysql出现“SELECT list is not in GROUP BY clause and contains nonaggregated column [duplicate]”错误提示
项目跨平台时由于mysql设置的问题,原代码运行出现这个错误,此时把mysql设置改下就好了 sql_mode='NO_ENGINE_SUBSTITUTION'
- mysql 8.0下的SELECT list is not in GROUP BY clause and contains nonaggregated column
mysql的版本 mysql> select version();+-----------+| version() |+-----------+| 8.0.12 |+-----------+ 在 ...
- [mysql] Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'loser.tank_admin.login_ip' which is not functionally dependent on columns in GROUP BY clause; this is
执行SQL: SELECT login_name,login_ip,sex FROM tank_admin GROUP BY login_name ; 时抛出异常. Expression #2 of ...
- 【mybatis】【mysql】mybatis查询mysql,group by分组查询报错:Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
mybatis查询mysql,group by分组查询报错:Expression #1 of SELECT list is not in GROUP BY clause and contains no ...
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'blog.t_blog.addTime' which is not functi
sql报错: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT ...
- 记录一次mysql由5.6升级到5.7出现的异常---Expression #23 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'c.commentCount' which is not functionally dependent on columns in GROUP BY clause;
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expre ...
- MYSQL报错:1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'rpa ...
- mysql升级后出现Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'userinfo.
安装了mysql5.7,用group by 查询时抛出如下异常: Expression #3 of SELECT list is not in GROUP BY clause and contains ...
- SELECT list is not in GROUP BY clause and contains nonaggregated column
报错如下: Expression # of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘sss.m ...
随机推荐
- 浏览器JS报错Uncaught RangeError Maximum call stack size exceeded
JavaScript错误:Uncaught RangeError: Maximum call stack size exceeded 堆栈溢出 原因:有小类到大类的递归查询导致溢出 解决方法思想: A ...
- Python基础-修改excel、redis、接口开发、组织代码
pymysql模块补充内容 1. 游标.description():显示表的字段属性 (什么是游标:游标用于交互式应用,就好比word里的光标一样,要修改某个地方,要先把光标移动到这里) 用好这个方法 ...
- JQ02
JQ02 1.css操作 .css(属性名,属性值)://要有双引号 修改单个样式,若要修改多个,需采用以下方式: 以对象为参数 它还可以获取样式: .css("属性名") 若元素 ...
- Codefoces909E Coprocessor(拓扑排序)
http://codeforces.com/problemset/problem/909/E 由于分了两个queue,所以push的时候可以统一操作,不会影响彼此.两个queue相当于是平等的,只是q ...
- ES5, ES6, ES2016, ES.Next: What's going on with JavaScript versioning?
JavaScript has a strange naming history. For its initial release in 1995 as part of Netscape Navigat ...
- linux 新建用户、用户组 以及为新用户分配权限(转)
本文转自https://www.cnblogs.com/clicli/p/5943788.html 感谢作者 Linux 系统是一个多用户多任务的分时操作系统,任何一个要使用系统资源的用户,都必须首先 ...
- VB编写的程序加入防火墙的例外中
在工程中要先引入: NetCon 1.0 Type Library NetFwTypeLib Option Explicit Const NET_FW_SCOPE_ALL = 0 Const NET_ ...
- FileUpload1.PostedFile.FileName 获取的文件名
例如文件叫做 c:\web\a.jpg 如果用IE,则返回 c:\web\a.jpg 含路径 如果用Chrome,则返回 a.jpg 不含路径.
- Linux出现Read-only file system错误的解决方法
造成这个问题的解决办法大多数是由于非正常关机后导致文件系统受损引起的,在系统重新启动之后,受损分区就会被Linux自己主动挂载为仅仅读.解决办法是通过fsck来修复文件系统,然后重新启动就可以,下面是 ...
- 学习ReentrantLock
1. 使用ReentrantLock import java.util.concurrent.locks.ReentrantLock; public class TestReentrantLock { ...