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服务,异常解决

 

posted @ 2017-12-27 10:58  人丑没钱嘴不甜  阅读(814)  评论(0编辑  收藏  举报