项目场景:
导入数据库 SQL 文件 出现导入错误
问题描述:
Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
原因分析:
由于 mysql 版本不同,导致 5 以上会存在相关问题
解决方案:
在数据库中运行一下命令,但是该命令是一次性的,每次重新启动后需要重新运行一次。
show variables like “sql_model”;
set sql_mode=’’;
set sql_mode=‘no_engine_substitution,strict_trans_tables’;