#1055 - Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this i

Posted 普通网友

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了#1055 - Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this i相关的知识,希望对你有一定的参考价值。

mysql报错

#1055 - Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this is incompatible with sql_mode=only_full_group_by


解决办法:1

 steps to success:

  1. sudo vim /etc/mysql/conf.d/mysql.cnf
  2. Scroll to the bottom of file Copy and paste

    [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

to the bottom of the file

  1. save and exit input mode
  2. sudo service mysql restart to restart MySQL.

Done!


2
mysql -u root -p
mysql > SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

You might need sudo for the first step:

sudo mysql -u root -p

这是stackoverflow上的回答,解决了我的问题,顺便说一句,中国的社区真垃圾,回答的解决办法都是屁话

以上是关于#1055 - Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this i的主要内容,如果未能解决你的问题,请参考以下文章

1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contai

解决[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause 的问题 MySQL

[Err] 1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated colum

[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated

MYSQL报错:1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated col

mysql错误:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggr