[MySQL] java.sql.SQLTransientConnectionException: (conn=55) Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '='

Dana's Log·2022년 5월 17일
0

발견 :
한글 입력 후 db 전송

오류 및 원인 :
java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '='
collate 문자셋이 서로 달라서 발생

해결 :
테이블 문자셋만 변경해서는 오류가 해결되지 않아서 데이타베이스와 해당 테이블의 collate 문자셋을 모두 변경

alter database [DB_NAME] character set utf8 collate utf8_general_ci;
alter table [TABLE1] convert to character set utf8 collate utf8_general_ci;
alter table [TABLE2] convert to character set utf8 collate utf8_general_ci;
profile
다나로그

0개의 댓글