Mysql 5.7 用group by 分组时错误:functionally dependent on columns in GROUP BY clause; this is incompatible

/etc/mysql/mysql.conf.d$ vim mysqld.cnf
在文件头出添加如下内容:

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

重启mysql:
service mysql restart
截图

注意如果上述没有起作用:第二个红框已经写明白了,复制该文件到/etc/mysql下。然后在重启msyql即可。

猜你喜欢

转载自blog.csdn.net/oMengQiQi1/article/details/84653856
今日推荐