Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation


mysql에서 다음과 같은 오류가 발생했다면 character set의 문제라고 볼수 있습니다.


1. mysql에 접속합니다.


[root@localhost~]# mysql -uroot -p

Enter password:


2. 데이터 베이스를 선택합니다.


[root@localhost~]# use 내가사용할db이름;


예시)

[root@localhost~]# use changmin;


3. 테이블의 collation을 변경해줍니다.


[root@localhost~]# alter table 테이블이름 default character set utf8 collate utf8_general_ci;


예시)

[root@localhost~]# alter table changmin default character set utf8 collate utf8_general_ci;


 utf8이 아닌 다른 캐릭터셋을 변경하고 싶다면 다른 캐릭터셋을 입력하시면 됩니다.


+ Recent posts