mysql 5.7版本出错 which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
错误信息:
which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
解决一:
执行以下代码,把mysql5.7的mode是STRICT_TRANS_TABLES
改成NO_ENGINE_SUBSTITUTION
,也就是从严格模式改成宽松模式
-- 查看 MySQL 版本
SELECT VERSION();
-- 查看 sql_mode
SELECT @@sql_mode;
-- 设置宽松模式
set @@global.sql_mode
='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
注意未生效请重启sql