1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contai…
错误现象
ubuntu环境,安装mysql成功后,创建数据库,创建表时,遇到这个错误:
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
解决方案
在网上找了挺久,最终找到解决方案:
修改配置文件:在配置文件里加一句就可以了:
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
我的是ubuntu 18.04,修改配置文件位置: /etc/mysql/mysql.conf.d/mysqld.cnf
参考帖子