MySQL this is incompatible with sql_mode=only_full_group_by having count

Just_Esme

关注

阅读 48

2022-07-12


查看当前mysql的sql_mode配置:

select @@GLOBAL.sql_mode

MySQL this is incompatible with sql_mode=only_full_group_by having count_mysql


就是这里限制了,解决办法如下:

vim /etc/my.cnf

在mysqld下面加上这个:

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

再次查询:

MySQL this is incompatible with sql_mode=only_full_group_by having count_mysql_02


查询有重复的值:

SELECT id,count(*) as counts FROM `apps` GROUP by name HAVING count(id)>1


精彩评论(0)

0 0 举报