2021-03-15 | UNLOCK

mysql出现GROUP BY clause错误解决办法

1.查询这两个

select @@sql_mode,@@global.sql_mode;

2.修改这两个

set @@global.sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';

set @@sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';

3.再查询这两个,确保修改成功

select @@sql_mode,@@global.sql_mode;

解决方案来源