The error “General error: 1366 Incorrect string value: ‘\\xE0\\xA4’ for column ‘page’ at row 1” in MySQL indicates a character set mismatch. This occurs when you are attempting to insert data containing characters that are not supported by the character set defined for the ‘page’ column or the table/database. The hexadecimal sequence \xE0\xA4 represents a portion of a multi-byte character (likely a Unicode character) that cannot be correctly interpreted by the current character set settings.
To resolve this issue, you need to ensure that the character sets are consistent across your database, tables, columns, and the client connection:
- Database, Table, and Column Character Sets:
- Verify that the database, the table containing the ‘page’ column, and the ‘page’ column itself are configured to use a character set that supports the characters you are trying to insert.
utf8mb4is generally recommended for full Unicode support, including emojis.
- Verify that the database, the table containing the ‘page’ column, and the ‘page’ column itself are configured to use a character set that supports the characters you are trying to insert.
Code
ALTER DATABASE your_database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
ALTER TABLE your_table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE your_table_name MODIFY COLUMN page VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
- Client Connection Character Set:
- Ensure that your client application (e.g., PHP, Python, Java, or a database client like MySQL Workbench) is also communicating with the MySQL server using the correct character set (e.g.,
utf8mb4). This is often done by setting the character set during the connection or by executingSET NAMES utf8mb4;after establishing the connection. - Example for PHP (using PDO):
- Ensure that your client application (e.g., PHP, Python, Java, or a database client like MySQL Workbench) is also communicating with the MySQL server using the correct character set (e.g.,
Code
$pdo = new PDO(
"mysql:host=localhost;dbname=your_database_name;charset=utf8mb4",
"username",
"password",
[PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8mb4"]
);
- Data Consistency:
- If you are loading data from a file (e.g., CSV), verify that the file itself is encoded in UTF-8. If not, convert the file to UTF-8 before importing.
By aligning the character sets throughout your database system and client application, you can prevent this “Incorrect string value” error and successfully store and retrieve data containing a wide range of characters.







