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이 아닌 다른 캐릭터셋을 변경하고 싶다면 다른 캐릭터셋을 입력하시면 됩니다.
'개인공부 > CentOS, PHP, MySQL' 카테고리의 다른 글
MySQL 이모티콘(Emoji) 삽입하기 (0) | 2018.07.02 |
---|---|
Mysql(Mariadb) 한글깨짐 해결 (0) | 2017.12.22 |
Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. (0) | 2017.12.18 |
Warning: mysqli::mysqli(): (HY000/2002): Permission denied in (0) | 2017.12.18 |
CentOS APM 설치 - 20171215 (0) | 2017.12.16 |