mysql5.7版本有用group by的时候sql_model有时候要调整,比如报错
which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
,就要设置my.ini里面的配置如下:
[mysqld] #其它省略 sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
重新启动mysql没问题,但是重启软件后又启动不了mysql了,报错:
[ERROR] D:\phpstudy_pro\COM\..\Extensions\MySQL5.7.26\\bin\mysqld.exe: Error while setting value 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_ENGINE_SUBSTITUTION' to 'sql_mode'
解决:
就是phpstudy的一个bug,莫名其妙吧上面的sql_model的逗号后都加上了空格,手动去掉后重启就行了。