Error: This was incompatible with sql_mode=only_full_group_by

Source: Internet
Author: User

Expression #1 of SELECT list is not in GROUP by clause and contains nonaggregated column ' H5app_workreport.c.id ' C1>this is incompatible with sql_mode=only_full_group_by

Reason:

The reason for this error is the high version of MySQL (client Server version 5). 7.18) The default Sql_mode contains only_full_group_by, which guarantees that the columns that are select to appear in GROUP by.

The statements for viewing Sql_mode are as follows:

SELECT @ @GLOBAL. sql_mode;

Solution:

Method one. You can use the SQL statement to temporarily modify the Sql_mode, restart MySQL after the event:

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 '

Method Two: Modify the MySQL configuration file, by manually adding Sql_mode way to enforce the specified do not need only_full_group_by property, my.cnf in the ETC folder, VIM under the cursor moved to the end,

Add the following:

Sql_mode=strict_trans_tables,no_zero_in_date,no_zero_date,error_for_division_by_zero,no_auto_create_user,no_ Engine_substitution

Error: This was incompatible with sql_mode=only_full_group_by

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.