Notice
Recent Posts
Recent Comments
Link
gyeomii
PyMysql - 'cp949' codec can't decode ... 본문
반응형
charset = 'euc-kr'이 아니라 'euckr'로 입력해야 한다.
conn = pymysql.connect(host='localhost', port=3306, user='root',
password='0000', db='world', charset='utf-8')
이렇게 커넥션 객체를 생성하고 DB에 Insert를 수행하는데 자꾸 'cp949' codec can't decode ... 오류가 발생했다.
utf-8 대신에 cp949, euc-kr 을 적어봐도 계속 오류가 발생해서
conn = pymysql.connect(host='localhost', port=3306, user='root',
password='0000', db='world', charset='euckr')
로 입력하니까 해결됐다.
반응형
'오류해결모음' 카테고리의 다른 글
Spring Boot - gradle JPA 연동방법 (0) | 2023.04.27 |
---|---|
PostgreSQL - Column does not exist 해결 (0) | 2022.12.09 |