1

mysql sql_mode怎么修改

 2 years ago
source link: https://www.oschina.net/question/5120604_2324079
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

mysql sql_mode怎么修改

失_心_疯 发布于 昨天 17:29

mysql5.7版本报错信息

bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ware_devops.work_order_bike.bike_no' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

查了下发现是sql_mode的问题,但是我用网上的办法

sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
修改也没能成功。而且重启后的sql_mode又变回来了。想试试修改my.cnf文件,但是我是window系统,根据网上给的/etc/my.cnf也根本没办法找到路径,请问我是要修改哪个文件才有用呢?my.ini吗


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK