반응형
250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- chart.js
- Flux
- VPN
- chartjs
- codedeploy error
- COALESCE
- 도커
- SQL
- bootstrap
- or some instances in your deployment group are experiencing problems.
- Airflow
- kubeflow
- Spring
- Python
- Spring Error
- IntelliJ
- aws cicd
- codebuild
- java bigdecimal
- Kafka
- Jenkins
- AWS CI/CD 구축하기
- codepipeline
- codedeploy
- PostgreSQL
- aws
- redis
- node
- JavaScript
- docker
Archives
- Today
- Total
Small Asteroid Blog
[sql] functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by 본문
백엔드/DB
[sql] functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
작은소행성☄️ 2023. 1. 4. 23:47728x90
잘못된 쿼리를 사용해서 생기는 오류이므로 서버 설정보다 쿼리로 해결할 수 있도록 하는게 좋다.
쿼리로 해결하기
쿼리 상의 GROUP BY 절을 따로 분리해 준다.
서버 설정으로 해결하기
MySQL 실행 시 only_full_group_by 옵션의 활성화/비활성화를 비활성화 한다.
1.
mysql 설정 상태 확인
> select @@sql_mode;
2.
mysql 설정이 되있음을 확인 (아래 출력 처럼 only_full_group_by이 나오면 설정이 필요)
> | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE, DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
3.
my.cnf 설정파일의 해당 부분을 추가 (linux 기준 /etc/my.cnf)
[mysqld]에 아래 설정 추가
> sql_mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
4.
mysql 재기동
> service mysqld restart
728x90
반응형
'백엔드 > DB' 카테고리의 다른 글
[MySQL] MySQL에 csv 파일 INSERT 하기 (0) | 2023.03.21 |
---|---|
[MySQL] 데이터 null 을 0 으로 (0) | 2023.03.15 |
[mysql] Failed to determine a suitable driver class (0) | 2022.11.08 |
MySQL EXPLAIN 실행 계획 보기 (쿼리 최적화 하기) (0) | 2022.08.19 |
[PostgreSQL] 중복 데이터 하나만 남기고 삭제하기 delete (0) | 2022.04.08 |