[MySQL] sql_mode=only_full_group_by 에러 해결 방법

2023. 8. 11. 10:02·Development/MySql

에러 내용

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'LG_NAVER_FINANCE.naver_finance_db.sd_idx' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'DB명.테이블명' which is not functionally dependent on columns in GROUP BY clause; 
this is incompatible with sql_mode=only_full_group_by

아래 쿼리로 현재 DB에 설정되어있는 sql_mode를 볼 수 있다.

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가 들어있다. MySQL 5.7 버전 이상부터 바뀌었다고 한다.

버전은 아래 쿼리로 조회할 수 있다.

SELECT VERSION()

현재 사용중인 MySQL 5.7.32 버전이다.

'Development > MySql' 카테고리의 다른 글

[MySQL] 생성된 컬럼에 auto_increment 속성 부여하기  (0) 2023.08.25
[MySQL] MySQL server has gone away  (0) 2023.08.11
[MongoDB] MongoDB를 MySQL으로 마이그레이션 하기  (0) 2023.08.07
[MySQL] 테이블 깨졌을 때 복구하기  (0) 2023.08.04
[MySQL] checking permissions  (0) 2023.05.04
'Development/MySql' 카테고리의 다른 글
  • [MySQL] 생성된 컬럼에 auto_increment 속성 부여하기
  • [MySQL] MySQL server has gone away
  • [MongoDB] MongoDB를 MySQL으로 마이그레이션 하기
  • [MySQL] 테이블 깨졌을 때 복구하기
곽진돔
곽진돔
Developer
  • 곽진돔
    echo "곽박한 세상";
    곽진돔
  • 전체
    오늘
    어제
    • 분류 전체보기 (184)
      • Development (57)
        • Linux (13)
        • k8s (3)
        • Docker (5)
        • AWS (1)
        • PHP (35)
        • Python (21)
        • Java (1)
        • SpringBoot (4)
        • JavaScript (1)
        • React (8)
        • MySql (19)
        • MongoDB (1)
      • Daily (4)
      • Study (6)
        • TIL (1)
        • license (3)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
    • 글쓰기
    • 설정
  • 링크

    • github
  • 공지사항

  • 인기 글

  • 태그

    UTF8
    Shell
    윈도우
    JavaScript
    IP
    error
    chromedriver
    인코딩
    Java
    정규표현식
    크롤링
    Python
    docker
    php
    CentOS
    CentOS7
    리액트
    스프링부트
    리눅스
    Linux
    Selenium
    ssh
    db
    react
    date
    SQL
    MySQL
    HTML
    nodejs
    springboot
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
곽진돔
[MySQL] sql_mode=only_full_group_by 에러 해결 방법
상단으로

티스토리툴바