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 -A Welcome 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'
- 临时修改示例
Mysql err 1055的更多相关文章
- MySQL [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause
MySQL[Err]1055 上次MySQL5.7.19主从建立完成之后,所有的测试都是在MySQL命令行下进行的,最近用Navicat Premium进行MySQL的连接,然后在插入数据的时候MyS ...
- mysql [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 GRO
[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated c ...
- mysql主给备赋予权限时报错,MySQL [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause
https://www.cnblogs.com/skymyyang/p/7551646.html 在my.cnf 里面设置sql_mode='STRICT_TRANS_TABLES,NO_ZERO_I ...
- [bug]MySQL [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause
参考 http://www.10qianwan.com/articledetail/220315.html
- mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY
mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY 今天开发的同事发来如下错误信息,最最简 ...
- mysql错误:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated
今天迁移django数据库的时候,跑程序的时候出现这样的错误: [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY cla ...
- MySql插入数据成功但是报[Err] 1055
1.问题: 这两天做insert操作,mysql版本是5.7,insert后虽然成功了,但是会报一个[Err] 1055的错误.具体如下: 2.解决方案: linux环境下,vim到my.cnf,添加 ...
- [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause 的问题 MySQL
问题:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregate ...
- [err] 1055
本人mysql安装在ubuntu16.04上,mysql版本是5.7.19:在创建表和插入数据时报了 [Err] 1055 - Expression #1 of ORDER BY clause is ...
随机推荐
- UC和QQ两个主流浏览器 * 点击触发微信分享到朋友圈或发送给朋友的功能(转载)
转载(声明:仅供学习使用) /** * 此插件主要作用是在UC和QQ两个主流浏览器 * 上面触发微信分享到朋友圈或发送给朋友的功能 * 代码编写过程中 参考: * http://mjs.sinaimg ...
- ThreadLocal的一些总结
ThreadLocal.class /** * Sets the current thread's copy of this thread-local variable * to the specif ...
- golang运算与循环等
一.golang运算符 1.算术运算符 + 相加- 相减* 相乘/ 相除% 求余++ 自增-- 自减 2.关系运算符 == 等于!= 不等于> 大于< 小于>= 大于等于<= ...
- springboot 打war
pom.xml <packaging>war</packaging> <!-- 打包设置 --> <plugins> <plugin> &l ...
- SQLSERVER 实现三元运算符
三元运算符在很多种编程语言中都存在,那么在SQL Server中有没有呢? 很遗憾,SQL server中并没有这个功能,三元运算符是什么呢? 这是一段表达式:[条件 ? 满足返回值 : 不满足返回值 ...
- rt-thread 之网络组件
@2019-02-23 [小记] 文件 <net_sockets.c> 为兼容标准 BSD Socket API 文件 <sal_socket.c> 为网络中间抽象层 文件 & ...
- Markdown初入门(使用Typora编辑)
标题 使用#来实现标题的大小控制 # h1 标题1 ## h2 标题2 ### h3 标题3 #### h4 标题4 ##### h5 标题5 ###### h6 标题6 标题一 标题二 标题三 标题 ...
- jvm学习笔记一(垃圾回收算法)
一:垃圾回收机制的原因 java中,当没有对象引用指向原先分配给某个对象的内存时候,该内存就成为了垃圾.JVM的一个系统级线程会自动释放该内存块.垃圾回收意味着程序不再需要的对象是"无用信息 ...
- Java基础 -- final关键字
在java的关键字中,static和final是两个我们必须掌握的关键字.不同于其他关键字,他们都有多种用法,而且在一定环境下使用,可以提高程序的运行性能,优化程序的结构.下面我们来了解一下final ...
- go interface接口
一:接口概要 接口是一种重要的类型,他是一组确定的方法集合. 一个接口变量可以存储任何实现了接口方法的具体值.一个重要的例子就是io.Reader和io.Writer type Reader inte ...