mysql5. Version 7 SQL_ mode=only_ full_ group_ By problem

goodlook0123 2022-02-13 08:17:11 阅读数:756

mysql5. mysql version sql_ sql

from mysql5.7 Most people who come here in the following version are interested in this group by  Unaccustomed 5.7 Of only_full_group_by, That is, all the displayed columns need group by. Today, I reported an error when running the application in another database , The following log :

Caused by: java.sql.SQLSyntaxErrorException: Expression #24 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'trial.ct.case_type_name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:536) ~[mysql-connector-java-6.0.6.jar!/:6.0.6]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513) ~[mysql-connector-java-6.0.6.jar!/:6.0.6]

The operation is as follows :

Enter the path :/etc/mysql/mysql.conf.d/mysqld.cnf,

stay mysqld Lower setup , Pictured :

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

 

restart mysql The service can be :

service mysql restart

copyright:author[goodlook0123],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130817095650.html