MySQL 5.7 이상으로 버전을 올렸더니 오류가 발생함.
집계되지 않는 컬럼에서 오류가 발생 되는 듯.
해결방법>
- 'my.cnf' 파일 열기
vi /usr/local/etc/my.cnf
(본인은 Homebrew 로 mysql 설치해서 경로가 '/usr/local/etc/my.cnf' 로 지정 돼 있고 설치 환경에 따라 경로는 달라질 수 있음.) -
[mysqld] 하단에 '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
- 저장 후 mysql 재시작
sudo service mysql restart to restart MySQL.
Done!
#1055 - Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this is incompatible with sql_mode
my Query : select libelle,credit_initial,disponible_v,sum(montant) as montant FROM fiche,annee,type where type.id_type=annee.id_type and annee.id_annee=fiche.id_annee and annee = year(
stackoverflow.com
https://lottogame.tistory.com/3686
macOS에서 my.cnf 파일의 위치
macOS에서 my.cnf 파일의 위치 이 자습서 를 따라 MySQL에 원격으로 액세스 하려고합니다 . 문제는 my.cnf 파일을 어디에 배치해야 하는가입니다. Mac OS X Lion을 사용하고 있습니다. MySQL 포럼 의이 스레��
lottogame.tistory.com
'Backend > DB' 카테고리의 다른 글
[MySQL] Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 해결법 (0) | 2020.08.20 |
---|---|
[Mysql] 설치 및 dump file import 까지 (0) | 2020.08.20 |
[MySql] 자연어 검색 플러그인 Mecab (FullText, 한글 검색 ...) (0) | 2020.08.19 |
[MySql] FullText 설정 관련 블로그 (0) | 2020.08.18 |
[MYSQL] grant all on *.* to 'root'@'%' identified by 'password' with grant option; 실행 시 ERROR 1064 (42000) 오류 해결 (0) | 2020.07.07 |