新建mysql 报only_full_group_by

[Err] 1055 - Expression #10 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'qr.wb.unloading_date' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

解决方法:

打开mysql命令行:

select @@sql_mode;

查下结果:

ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

编辑/etc/my.cnf文件:

删除查下结果中ONLY_FULL_GROUP_BY, 添加

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION;

扫描二维码关注公众号,回复: 2742521 查看本文章

保存并重启mysql

猜你喜欢

转载自www.cnblogs.com/vwater/p/9468173.html
今日推荐