ubuntu with sql_mode=only_full_group_by
时间: 2023-09-14 21:11:01 浏览: 196
对于Ubuntu操作系统中使用MySQL,并且设置了sql_mode=only_full_group_by的情况,你可以按照以下步骤进行操作:
1. 打开终端,使用管理员权限登录到系统。
2. 打开MySQL配置文件my.cnf:sudo vi /etc/mysql/my.cnf
3. 在文件的末尾,或者在标签下添加以下内容:sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
4. 保存并退出文件。
5. 重启MySQL服务:sudo service mysql restart
这样,你的MySQL服务器就会以设置了指定的sql_mode值启动,并包括了only_full_group_by。这将确保在进行GROUP BY查询时,MySQL会强制要求SELECT语句中的列要么在GROUP BY子句中,要么在聚合函数中。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [【sql_mode=only_full_group_by问题解决方案】](https://blog.csdn.net/qq_39127761/article/details/124702695)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [解决服务器(本地)mysql数据库报 this is incompatible with sql_mode=only_full_group_by错误](https://blog.csdn.net/weixin_52473844/article/details/128671721)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文