Mysql 5.7版本报错 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

 解决方法:

对于错误err1055查询了很久,说是5.7版本开始对sql的分组查询有了一个语法的检测,对于之前的sql就会出现一些错误,只要吧sqlmodel中的only_full_group_by去掉就行了。

#查询sqlmodel模式:select @@global.sql_mode

设置sqlmodel 模式: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‘

时间: 2024-10-09 00:41:39

Mysql 5.7版本报错 1055的相关文章

windows server 2008 安装MySQL 8.0 遇到报错 1055 - Expression #1 of ORDER BY clause is not in GROUP BY

mysql安装参考教程:https://blog.csdn.net/qq_37350706/article/details/81707862 安装完毕后 执行sql语句 SELECT * FROM court_info GROUP BY second_court_name HAVING COUNT(second_court_name) > 1 报错 [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause an

native 链接 mysql 8.0以上版本 报错2059

MySQL版本是8.0.4  由于新版本的MySQL新特性导致的. mysql> select Host,User,plugin from mysql.user; +-----------+------------------+-----------------------+ | Host | User | plugin | +-----------+------------------+-----------------------+ | localhost | mysql.infoschem

mac系统中搭建apache+mysql+php的开发环境,安装mysql后,登录报错:mac ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

php新手在mac系统中搭建apache+mysql+php的开发环境(按照这篇博客来操作的:http://my.oschina.net/joanfen/blog/171109?fromerr=xvCsafCe),在安装配置mysql完毕后,登录mysql,报错:mac ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO),折腾很久,终于解决,随手记录下,备忘. 解决方法: 第一步:如

导入MySQL测试数据库employee报错

导入MySQL测试数据库employee 报错 下载地址:https://launchpad.net/test-db/ 上传解压: [[email protected] ~]# tar xf employees_db-full-1.0.6.tar.bz2 [[email protected] ~]# cd employees_db 使用mysql命令行工具,导入建库建表语句和数据 employee.sql中是建库建表语句,默认使用的是InnoDB引擎,可以自行修改 [[email protect

MYSQL 添加外键报错

2014年6月16日 10:48:51 出错的部分提示摘录: #1452 - Cannot add or update a child row: a foreign key constraint fails result 2 when explaining filename '#sql-3d5_204369' 解决办法: pma 中同时执行两条语句: set foreign_key_checks = 0; ALTER TABLE `table_name` ADD CONSTRAINT `fk_n

关于mysql 5.7版本“报[Err] 1093 - You can't specify target table 'XXX' for update in FROM clause”错误的bug

不同于oracle和sqlserver,mysql并不支持在更新某个表的数据时又查询了它,而查询的数据又做了更新的条件,因此我们需要使用如下的语句绕过: UPDATE teaching_department SET code_year = 2017, notice_code = (SELECT a.code + 1 FROM (SELECT MAX(notice_code) code FROM teaching_department WHERE department_id = 6284 and

MySQL root密码重置 报错:mysqladmin: connect to server at 'localhost' failed的解决方案

===========================================================二,忘记本地root的登录密码解决过程:1.编辑/mysql/my.ini在[mysqld] 配置部分添加一行skip-grant-tables 2.保存后重启mysql[[email protected] etc]# service mysqld restartShutting down MySQL.                                      

Mysql连接数不够(报错连接数太多)

Mysql连接数不够(报错连接数太多): 查看当前连接数: netstat -anp | grep 3306 | wc -l 查看mysql配置的最大连接数(默认为151): show variables like 'max_connections'; 修改连接数(建议设为600,即1000以内): vi /etc/my.cnf ([mysqld]在写入) max_connections = 600:wq /etc/init.d/mysql restart 原文地址:http://blog.51

Linux中mysql进入命令行报错:MYSQL ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.99.192' (111)

场景:在Linux中安装mysql01和mysql02,通过VIP虚出一个VIP=192.168.99.192,mysql01为主ip为192.168.99.153,mysql02为备机ip为192.168.99.154 此时VIP在mysql01上通过 mysql01上连接VIP :mysql -h 192.168.99.192 -P 3306   结果是可以正常进入mysql命令行: 通过mysql02上远程连接VIP 会在界面上报错:mysql error 2003(HY000):Can'