mysql5.7.14 group by 字段中内容是中文报错的解决方法

 

 

想通过tag字段来分组,报出以下异常

1055 Expression #8 of SELECT list
is not in GROUP BY clause and contains nonaggregated column 'wis.Tags.id' which is not
functionally dependent on columns in GROUP BY clause; this is incompatible with 
sql_mode=only_full_group_by

主要是sql_mode 中有一个 only_full_group_by 的值,用sql在服务器上查了一下里面的确有这个参数

首先在服务器上登录mysql :" mysql -u root -p"

查询在sql_mode中是否有only_full_group_by 参数

接下来查看sql_mode

 查询结果如下

 发现的确在sql_mode中有only_full_group_by这个参数,然后重新设置sql_mode的值

修改后查询sql_mode

此时发现only_full_group_by已经没有了

重启mysql服务,异常解决

 

转载于:https://www.cnblogs.com/royal-salute/p/8124692.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值