Mysql err 1055
目录:
错误信息
原因分析
解决方案
操作示例
- 错误信息
[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
- 原因分析
Mysql 中的SQL 语法并不是严格按照SQL 95 标准的。在聚合操作时,group by 允许不包含所有select的非聚合 列.
参数sql_mode='ONLY_FULL_GROUP_BY' 可以使SQL 严格按照SQL 95标准编写,但是同时此参数是存在缺陷的。一些delete 等非聚合操作,从java 客户端发起时,有可能会引起错误:[err] 1055.
- 解决方案
简单的解决方案就是取消此参数设置。参数的设置方法如下:# 临时调整 set @@sql_mode='参数列表,以逗号分隔' 或者 set global sql_mode='参数列表,以逗号分隔' # 永久调整 修改参数配置文件my.cnf sql_mode = '参数列表,不同参数之间以逗号分隔'
- 示例
- 临时修改示例
mysql> 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'; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye [root@test ~]# mysql -D Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -AWelcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1814164 Server version: 5.7.17 MySQL Community Server (GPL)Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> select @@sql_mode; +------------------------------------------------------------------------------------------------------------------------+ | @@sql_mode | +------------------------------------------------------------------------------------------------------------------------+ | STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | +------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
- 永久修改示例
# 修改之前 sql_mode='ONLY_FULL_GROUP_BY,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' # 修改之后 sql_mode='NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
- 临时修改示例
转载于:https://www.cnblogs.com/halberd-lee/p/9876048.html
Mysql err 1055相关推荐
- linux系统mysql报err1055_MySQL Err 1055的解决
同事在5.7.14的mysql上创建的表,需要在服务器上同步,但是小版本变成了5.7.17(不知道与版本有没有关系) 在Navicat里执行创建表的sql命令时,报错Err 1055 [Err] 10 ...
- mysql创建表报错1055的原因_[Err] 1055
mysql 创建表是出现[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains non ...
- MySQL报错1055解决办法:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains
[mysql报错1055 报错解决办法][Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and cont ...
- 执行sql语句提示[Err] 1055 - Expression #2 of SELECT list is not in GROUP BY......错误的解决办法
当我在navicat中执行sql语句时,出现错误提示[Err] 1055 - Expression #2 of SELECT list is not in GROUP BY clause and co ...
- [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated
mysql客户端查询报这个错误,如下所示: [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and co ...
- [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated c
[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated c ...
- linux mysql 1055_mysql 1055错误
线上用的MySQL版本为5.7.11,线下用的5.6版本,发现将程序上线后,有些地方报这个错误 [Err] 1055 - Expression #1 of ORDER BY clause is not ...
- [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated解决
今天在使用MySQL查询时报了一个"[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and c ...
- MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
[实施工程师]MySQL:[Err] 1292 - Incorrect datetime value: '0000-00-00 00:00:00' for column 'CREATE_TIME' a ...
最新文章
- android 点击扩散,Android水波纹扩散效果
- 好用的浏览器_“遇见”一个好用的浏览器,功能非常强大到无法想象
- VSTO---excel编程 [待续] [12月5日更新,详见文档下面]
- [iOS Animation]-CALayer 变换
- Android Jetpack 之 ViewModel
- 中文命名实体识别,HMM,CRF,BiLSTM,BiLSTM+CRF的具体实现
- python编程入门-最好的Python入门教材是哪本?
- 可视化理解卷积神经网络 - 反卷积网络 - 没看懂
- unity 灯光阴影
- Android旅游APP类项目源代码
- (转) [it-ebooks]电子书列表
- ue4 源码编译 虚拟内存不足 堆限制
- noip模拟赛 whzzt-Warmth
- 半加器设计(结构描述法)
- 联想小新V1000外接R9-380显卡
- 何谓坚强----悼大哥
- SUBTOTAL函数的应用
- 分酒问题与JOJ 1200 Jugs
- java lua_请问该如何在Java中使用Lua脚本语言?
- springboot+quartz报错:Table ‘XXXX.QRTZ_TRIGGERS‘ doesn‘t exist