【MYSQL】5.7版本出错 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

解决一:

执行以下代码,把5.7的mode是STRICT_TRANS_TABLES改成NO_ENGINE_SUBSTITUTION,也就是从严格模式改成宽松模式

重启sql生效

-- 查看 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';

你可能感兴趣的:(mysql,sql,数据库)