首页> 开发问题 >后端问题 后端问题
MYSQL5.7版本sql_mode=only_full_group_by报错解决方案
作者:小萝卜 2019-06-18 【 MySql 】 浏览 2594
简介报错如下:SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'qdm67352293_db.ueo76_article.dates' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
之前一直用的是5.6版本的mysql,最近升级到5.7.9之后之前运行挺正常的项目报错:which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by。经过网上一番查找,解决如下:
我的mysql是部署在linux上的,修改/etc/my.cnf文件:
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER
关键是得有这个NO_AUTO_CREATE_USER,修改后重启mysql,运行正常。
很赞哦! (0)
相关文章
- TP6报错致命错误: Cannot use object of type stdClass as array
- windows下mysql中文乱码, 配置解决方法
- 错误400-The request sent by the client was syntactically incorrect
- tp3.2插入数据时SQLSTATE[HY000]: General error
- MySQL: unrecognized service错误解决办法
- 语法解析错误: syntax error, unexpected 'unset' (T_UNSET)
- laravel通过composer安装报错了The 'https://repo.packagist.org/p/laravel/laravel.json' file could not be downloaded: failed to open stream
- Site error: the ionCube PHP Loader needs to be installed.
- 网站打不开错误提示:ERR_CONTENT_DECODING_FAILED
- [vs code] 运行go包提示:Code is already running!