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 ...
随机推荐
- Oracle数据库访问其他用户下的表,不加表所属的用户名的实现方法
一. 问题: 如何实现在Oracle数据库中访问其他用户的表时不需加表所属的用户名 二. 举例: Oracle里面的用户A,要访问用户B的表需要带用户B的前缀,如访问用户B的 TEST表,需要这样访问 ...
- linux命令之free篇
作业二: 1.free命令查看内存 [root@localhost 桌面]# free total used free shared buffers cachedMem: 1003432 899760 ...
- poj1852 Ants(思维)
https://vjudge.net/problem/POJ-1852 最短时间显然是各自往靠近端点的地方走. 最长时间关键是要想到,折返和擦肩其实是一样的,可以当成两只蚂蚁换了个位子,最终求max是 ...
- bootstrap学习总结
bootstrap网站下载: 谷歌浏览器访问:http://github.com/twbs/bootstrap/ 右上角(clone or download) 编译版bootstrap:http ...
- django之内置Admin
本篇导航: 配置路由 定制Admin Django内置的Admin是对于model中对应的数据表进行增删改查提供的组件,使用方式有: 依赖APP: django.contrib.auth django ...
- springboot上传文件并检查图片大小与格式
@PostMapping(value = "/uploadDriverImage") public JsonResVo uploadDriverImage(@RequestPara ...
- Python3 与 C# 网络编程之~ 网络基础篇
最新版本查看:https://www.cnblogs.com/dotnetcrazy/p/9919202.html 入门篇 官方文档:https://docs.python.org/3/library ...
- Map network drive遇到报错“The network folder specified is currently mapped using a different user name and password”,怎么办?
--------------------------- Windows --------------------------- The network folder specified is curr ...
- linux clamav 免费查毒工具
linux下需要杀毒工具吗?我一直认为是不要的,基于linux的病毒很少,linux 安全防护也做的很好,一般很难功破.我想那些黑客们更喜欢,写windows下的病毒,用的人多啊,传播也容易.下面的操 ...
- Win10系统的SurfacePro4如何重装系统-2 重装WIN10系统
把SurfacePro充好电,然后关机,开机按住音量+,然后再按电源键,可以开机并进入BIOS(此前应确保优盘已经装了PE并插入Surface) 然后选择U盘启动为第一个(按住之后把他拖放到第一位 ...