MySQL throws this error when it encounters a byte sequence that cannot be converted into the target character set during data shifting or conversion.
MySQL Error 88: EE_SHIFT_CHAR_OUT_OF_RANGE occurs when a byte sequence cannot be represented in the target character set. Fix it by verifying source encoding, setting correct character_set_client and character_set_database, and cleansing or re-encoding invalid data.
Shift character out of range: %s. EE_SHIFT_CHAR_OUT_OF_RANGE was added in 8.0.13.
MySQL raises the global Error 88 - EE_SHIFT_CHAR_OUT_OF_RANGE when it attempts to convert a byte sequence that falls outside the valid range of the destination character set. The accompanying message prints the first problematic bytes so you can pinpoint the faulty data.
The condition was added in MySQL 8.0.13. It appears during SELECT, INSERT, UPDATE, LOAD DATA, replication, and client‐server transfers when character_set_client, character_set_connection, or character_set_database differ.
Resolving it is critical because conversion failures can abort statements, break replication, and corrupt text data.
Invalid or mixed-encoded text sent by the client triggers the error when MySQL cannot map bytes to the target collation.
Examples include Latin-1 bytes sent while the session expects UTF-8.
Bulk imports with LOAD DATA or mysqlimport often surface the problem because files may contain stray control characters or an unexpected encoding such as Windows-1252.
Replication between servers running different character_set_server or collation_server values can fail when row events contain bytes illegal in the replica’s character set.
Identify the offending bytes by reviewing the error message or running HEX() on suspect columns.
Once located, decide whether to re-encode, replace, or remove invalid characters.
Set the correct session variables before sending data: SET NAMES utf8mb4;
or explicitly configure character_set_client and collation_connection to match the source file.
Convert files externally with iconv or recode. Example: iconv -f WINDOWS-1252 -t UTF-8 input.csv -o clean.csv
then reload.
LOAD DATA INFILE fails on a CSV exported from Excel.
Solution - convert the file from Windows-1252 to UTF-8 and rerun the import.
Replication stops with the error on the slave. Solution - align character_set_server on master and slave, then re-sync the broken row with REPLACE or a fresh dump.
A web app sends JSON encoded in ISO-8859-1 while the connection expects utf8mb4.
Solution - enforce UTF-8 at the application layer and issue SET character_set_results = utf8mb4;
.
Standardize on utf8mb4 for character_set_server, client, and connection variables across all environments.
Validate incoming files with file -i
or iconv -c
during CI/CD pipelines to reject bad encodings early.
Use Galaxy’s SQL editor to preview imported text with HEX() and LENGTH() before committing changes, ensuring bad bytes are caught in development.
Error 1366: Incorrect string value - occurs when illegal bytes are inserted; fix methods are identical but reported at statement level instead of low-level shift.
Error 3751: Cannot convert string - raised by the conversion layer when an entire string, not just a byte, fails to map.
Error 1267: Illegal mix of collations - manifests when comparing or concatenating strings of incompatible collations rather than when shifting bytes.
.
Applications open a connection using utf8 but actually send Latin-1 or Windows-1252 bytes that contain characters above 0x7F.
The schema uses utf8mb4 while the server or replication channel runs latin1, leading to unmappable bytes during row events.
CSV or TSV files generated by legacy systems sometimes blend UTF-8 and ISO-8859-1 sequences, breaking the conversion logic.
Developers call SET NAMES utf8
but send utf8mb4 data containing four-byte characters, exceeding the utf8 range.
.
Enable --verbose
mode on import commands or add LOW_PRIORITY, SLEEP()
logic to binary search your dataset. The error message prints the first bad bytes, which you can locate using HEX() and LIKE BINARY.
No native setting allows silent skipping. You must cleanse data externally or via SQL functions such as REPLACE, CONVERT, or binary stripping.
Switching to utf8mb4 widens the valid range but still rejects malformed UTF-8 sequences. Always validate the actual encoding of source data.
Galaxy’s hex viewer and AI copilot suggest CONVERT and COLLATE clauses, letting you preview fixes in the editor before running them in production.