Solve the problem of MySQL database report 1055 error

MySql> SELECT * FROM ‘ONLY_FULL_GROUP_BY’ WHERE sql_mode = ‘ONLY_FULL_GROUP_BY’
MySql> delete the ONLY_FULL_GROUP_BY item from my.ini; delete the ONLY_FULL_GROUP_BY item from my.cnf
2. If there is no SQL_MODE item in the configuration item, use SQL statement to modify it
Find out sql_mode value

select @@sql_mode

Remove the only_full_group_by item from the value found and add the other items to the my.ini configuration file

sql-mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Configuration items in my.ini:

 
3. Do not modify any configuration files, but add any_value() to fields that do not need to be grouped

SELECT any_value(id),value FROM role group by value;

 

Read More: