升级mysql5.5到mysql5.7,查询警告 - this is incompatible with sql_mode=only_full_group_by

问题:升级mysql到5.7,导入mysql5.5的数据库,站点日志中,有类似 this is incompatible with sql_mode=only_full_group_by 的警告。

解决:在mysql的配置文件mysql.ini里加sql_mode的参数,如下边的内容:

[mysqld]
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

原因可能是新版本的mysql5.7与原sql查询语句不“兼容”。

参考:https://stackoverflow.com/questions/34115174/error-related-to-only-full-group-by-when-executing-a-query-in-mysql

标签: mysql

添加新评论