1

(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?

Jerry
  • 399
  • 1
  • 2
  • 17
  • https://dev.mysql.com/doc/refman/5.7/en/variables-table.html. You're setting some global or session variable to a value that's encoded in a way that's not supported. But it's impossible to say what, since you haven't provided a [mcve], or a proper traceback instead of just the error message. – Ilja Everilä Jun 02 '18 at 09:23
  • I get similar error it's depends of the caracters in my case shows this the error "sqlalchemy.exc.OperationalError: (MySQLdb.OperationalError) (1366, "Incorrect string value: '\\xC2\\x91IA I...' for column 'RZIMPO' at row 5")", the row fails is a 'ñ' – qleoz12 Nov 09 '22 at 20:51

2 Answers2

0

The error happens because you are trying to store an emoji using the wrong charset. Change the charset from utf8 to utf8mb4

Lone Ronin
  • 2,530
  • 1
  • 19
  • 31
0

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.

enter link description here

Nick Po
  • 128
  • 7