ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregate
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'DBname.table.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
平台: Mac OS X
报错: incompatible with sql_mode=only_full_group_by
版本: mysql Ver 14.14 Distrib 5.7.16, for osx10.11 (x86_64) using EditLine wrapper
参考: https://stackoverflow.com/questions/23921117/disable-only-full-group-by
搜索: "version 5.7.11 running on Mac OS X"
解决办法:
1)命令行登录mysql
2)直接执行下面语句:
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";
3)搞定