用sql命令创建数据库表时,报了一个1055的错误。
[Err] 1055 - 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
在网上试了很多资料,只有一种可行。
依次执行一下命令,便可以解决这个报错。
show variables like "sql_mode";
set sql_mode='';
set sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
其实就是把ONLY_FULL_GROUP_BY删除
上面的方法重启mysql后,就要重新设置。
为了方便,可以在my.ini配置文件设置,这样就不用每次都设置了。
错误原因还在寻找~~~