Reputation: 1
This error occurs whenever I try to insert below table in mysql schema.
I used code like this
self.collect.allday_list.to_sql(name=code_name, con=self.collect.engine_allday, if_exists='append')
and self.collect.egine_allday is
self.engine_allday = create_engine("mysql+mysqldb://" + info.db_id + ":" + info.db_passwd + "@"
+ info.db_ip + ":" + info.db_port + "/allday_list", encoding = 'utf-8')
and Warning: (1366, "Incorrect string value: '\xB4\xEB\xC7\xD1\xB9\xCE...' for column 'VARIABLE_VALUE' at row 1") result = self._query(query)
it doesn't have any emoji or special letter, but error is occurred how do i get this table into schema in mysql?
Upvotes: 0
Views: 523
Reputation: 111259
Somewhere in the data you are trying to insert there is text encoded in euc-kr
:
>>> bytes.decode(b'\xB4\xEB\xC7\xD1\xB9\xCE', encoding='euc-kr')
'대한민'
These bytes do not represent valid text in utf-8. You can try changing the database connection encoding to euc-kr
, or converting the data from euc-kr to utf-8 when you read it.
On the other hand, the screenshot of the data has only numbers, no text. This suggests you may be trying to load the wrong file or that perhaps there is a portion of the file that you didn't want to insert in the database.
Upvotes: 1