반응형
[2021.07.13] 인턴 +134 How to solve error: 1366, "Incorrect string value: '\\xEC\\x97\\x90\\xEB\\xB8\\x8C...' on Linux(Ubuntu) ?
해당 게시글은, 특정사이트(ㅂㄹㄱㅈㄱㄷ) 에 데이터를 리눅스에서 크롤링 하려고 시도하였으나,
아래와 같은 에러메세지가 나와서 해결방법을 알려주기 위해 게시하였다. (구글링으로 정보 얻음)
1366, "Incorrect string value: '\\xEB\\xAF\\xB8\\xEA\\xB5\\xAD
해결 방법
1. my.cnf 파일 설정 변경
whereis my.cnf
sudo vi /etc/my.cnf
sudo vi /etc/my.cnf
default-character-set=utf8
default-collation=utf8_general_ci
2. database, table character set 설정 (1번이 설정되면 바로 2번부터 하면 됨)
mysql> use KABL;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
* ALTER TABLE table_name convert to charset utf8;
mysql> ALTER TABLE Inquiry convert to charset utf8;
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
3. 완료 후 mysql 재시작
systemctl restart mysql
반응형
댓글