报错信息

SQL Error: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated > column ‘rong_hua.oeh.exam_paper_id’ which is not functionally dependent on columns in GROUP > BY clause; this is incompatible with sql_mode=only_full_group_by

报错原因是mysql开启了严格模式,关闭方法如下:

  1. 找到安装目录下的my.ini文件,没有的话就新建一个
  2. 找到mysqld项增加如[mysqld]下的代码
[mysqld]
sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
  1. 重启mysql即可解决报错
Logo

一站式 AI 云服务平台

更多推荐