Reputation: 424
(1366, "Incorrect string value: '\xB4\xEB\xC7\xD1\xB9\xCE...' for column 'VARIABLE_VALUE' at row 484")
This error occurs whenever I try to insert a row (for anytable) But I don't have any table which contains 'VARIABLE_VAULE' column.
SELECT DISTINCT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME IN ('VARIABLE_VALUE')
AND TABLE_SCHEMA='sw'; /* nothing comes up */
How do I locate the table which causes the warning?
Upvotes: 1
Views: 1801
Reputation: 158
The encoding used for Unicode has traditionally been 'utf8'. However, for MySQL versions 5.5.3 on forward, a new MySQL-specific encoding 'utf8mb4' has been introduced, and as of MySQL 8.0 a warning is emitted by the server if plain utf8 is specified within any server-side directives, replaced with utf8mb3. The rationale for this new encoding is due to the fact that MySQL’s legacy utf-8 encoding only supports codepoints up to three bytes instead of four. Therefore, when communicating with a MySQL database that includes codepoints more than three bytes in size, this new charset is preferred, if supported by both the database as well as the client DBAPI, as in:
e = create_engine(
"mysql+pymysql://scott:tiger@localhost/test?charset=utf8mb4")
All modern DBAPIs should support the utf8mb4 charset.
Upvotes: 2
Reputation: 2880
The error happens because you are trying to store an emoji using the wrong charset. Change the charset from utf8
to utf8mb4
Upvotes: 0