mysql 8.0 with new versions incompatibility group by statement

The new version appears mysql group by statement incompatibility
1, the specific error message:

 

 

[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

1.1, see sql_mode
the SELECT @@ global.sql_mode;

1.2、 查询出来的值为:
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

2, removed ONLY_FULL_GROUP_BY, reset the value.

2.1, above, it is to change the global sql_mode, valid for the new database. For existing database, carry out the data at the corresponding:
SET = the sql_mode 'the STRICT_TRANS_TABLES, the NO_ZERO_IN_DATE, the NO_ZERO_DATE, the ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION';

3 ,: modify my.cnf (my.ini is under windows) configuration file, delete only_full_group_by this one
if our project to install mysql in ubuntu above, find the file to open it, there was not sql_mode the configuration items, want to delete you did not have to delete.

Of course, there are other ways to open the mysql command line, execute the command
if [mysqld] This line is commented out, then remember to open the comment.
sql_mode = STRICT_TRANS_TABLES, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION

And then try to restart the mysql service
----------------
Disclaimer: This article is the original article CSDN bloggers "Dream____Fly", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/Dream____Fly/article/details/88779630

Guess you like

Origin www.cnblogs.com/tongcharge/p/11491782.html