0
点赞
收藏
分享

微信扫一扫

MySQL this is incompatible with sql_mode=only_full_group_by having count

Just_Esme 2022-07-12 阅读 48


查看当前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 条评论