mysql5.7 报错1055:Expression #1 of SELECT list is not in GROUP BY clause and contains non

(参考:https://blog.csdn.net/qq_24038207/article/details/79358644)经尝试未成功!!!

在上面修改的基础上,本人成功的解决方法,

cd /etc/mysql/mysql.conf.d/    

(有的mysql配置文件是 /etc/my.cnf ,而我的Ubuntu16.04 + mysql 5.7.24 下 mysql配置文件是这里 /etc/mysql/mysql.conf.d/)
sudo vim mysqld.cnf
[mysqld] 下添加:

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

结果如图:

mysql5.7 报错1055:Expression #1 of SELECT list is not in GROUP BY clause and contains non_第1张图片

搞定!!!

你可能感兴趣的:(mysql)