ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test1.p.type_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
mysql> show variables like 'sql_mode';
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| Variable_name | Value |
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| sql_mode | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set
The blogger's server is Ubantu, modify the /etc/mysql/mysql.conf.d file.
Add sql_mode under [mysqld]
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
character-set-server=utf8
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Because the newspaper isSql_mode=only_full_group_by error, remove it from sql_mode.
Save the configuration file.
/etc/init.d/mysql restart
Restart mysql and you're done.
Database query 1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘dkia_quality_db.b.id’ which is not functionally dependent on columns in GROU...
mysql version 5.7 Problems: Explanation: First of all, this problem appeared in the mysql5.7 version! And it's unique! Why does it appear? is because only_full_group is configured in sql_mode in the d...
I am a SQL practitioner in practice and measurement, and the problem is sql_mode problem Three steps to solve the problem: 1. Find my computer and find the configuration file my_ini file; 2. Copy the ...
During the development process today, because the previous project has been developed and the database migration has been completed, during the operation today, an error occurred when summing up by gr...
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'userinfo. Reproduced label: mysql / group-by / sql-mode 1469 Installed mysql5.7, as an exception thr...
Perform the following SQL error: Report error message: Error Code: 1055. Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘tp_music.singer.name’ whi...
Report in mysql grammar groupby Times wrong My MySQL version is: mysql-8.0.27 solution: Execute first The result is: Execute the following statement again Then,Restart navicat !!!Only will it take eff...
Error: The literal meaning is that sql_model=only_full_group_by is restricted, and the SQL that can be queried normally in the previous MYSQL version cannot be used in 5.7. Reference documents: http:/...
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘mome.a.type’ which is not functionally dependent on columns in GROUP BY clause...
Use query: result: Modify under centos: /etc/my.cnf file Remove ONLY_FULL_GROUP_BY, reset the value Add at the end Restart MySQL service ...