执行sql语句后报1055-- this is incompatible with sql_mode=only_full_group_by

这个问题是mysql5.7中存在的问题,查看原因,在任意库执行select @@sql_mode,查到的结果为ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,将里面的ONLY_FULL_GROUP_BY删除即可,执行语句set @@sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION',这个语句只改了当前库,如若想改所有库,则执行set @@global.sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

上一篇:MVC 的HTTP请求


下一篇:转载Javascript继承两种形式详解