错误信息:
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘database_tl.emp.id’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
原因分析:我也不晓得啥原因,但是我找到解决办法了。
解决办法:
Windows:修改配置文件my.ini
Linux:修改配置文件/etc/my.cnf
不管是啥平台,都在配置文件[mysqld]节点下添加:
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
然后重启mysqld服务即可。
本文详细介绍了如何解决在MySQL中遇到的ERROR1055(42000)错误,即“Expression in SELECT list is not in GROUP BY clause and contains non-aggregated column”。通过修改my.ini或my.cnf配置文件中的sql_mode参数为NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,并重启mysqld服务,可以有效解决这一问题。
984

被折叠的 条评论
为什么被折叠?



