mysql多表联合查询 [Err] 1055 - Expression #1 of SELECT list is not in GROUP BY clause this is incompati

在 mysql进行 多表联合查询, 出现以下错误:

[Err] 1055 - Expression #1 of SELECT list is not in GROUP BY clause
which is not functionally dependent on columns in GROUP BY clause; 
this is incompatible with sql_mode=only_full_group_by

在终端 vim /etc/mysql/my.cnf, 按 i  进入插入模式.

在 [mysqld] 下面添加:

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

然后 按 esc,  输入 :wq 保存.

输入以下命令重启MySQL:  systemctl restart mysqld

然后再尝试执行多表联合查询的语句, 可以正常查询.

上一篇:日常问题排查-调用超时


下一篇:Docker 中修改Mysql 数据库的 only_full_group_by 模式