mysql问题:
java.sql.SQLSyntaxErrorException: Expression #6 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘construction.a.name’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
linux服务器上解决问题命令:
1、找到my.cnf文件,并编辑 MySQL 的配置文件 my.cnf。一般都在etc/my.cnf或者etc/mysql/my.cnf
命令:sudo vi /etc/my.cnf
2、在文件中找到 [mysqld] 部分。按⬇️找。
3、在 [mysqld] 部分中添加或更新 sql_mode 配置。
先按键盘上的 i进入insert追加模式。
输入命令:sql_mode = 新的 sql_mode 值。我这里是:sql_mode = NO_ENGINE_SUBSTITUTION
4、保存并关闭。输入----> :w! 保存。:exit;退出
5、使用 systemctl list-units | grep mysql 命令来查找 MySQL 服务的确切名称。
[root@izwz91wrzuy6btm73ldtb7z services]# systemctl list-units | grep mysql
mysqld.service loaded active running MySQL Server
这里咱们的mysql服务名称就叫:mysqld
6、重新启动mysql
sudo systemctl restart mysqld
记录一下,目前是这么解决的