MySQL raises EE_UNKNOWN_CHARSET when it encounters a character set that is not compiled into the server or listed in its Index.xml definition files.
MySQL Error 22 EE_UNKNOWN_CHARSET appears when the server or client requests a character set that MySQL was not built with or cannot locate in its Index.xml. Use a supported character set, install the missing charset files, or recompile MySQL with the required charset to fix the problem.
Character set '%s' is not a compiled character set and is not specified in the '%s' file
Error message: Character set '%s' is not a compiled character set and is not specified in the '%s' file.
MySQL throws EE_UNKNOWN_CHARSET when it cannot load or recognize the character set requested by a client, column definition, or server variable. The server checks compiled charsets and the Index.xml file in the charset directory.
If the requested charset is absent, error 22 is raised and the statement fails.
Resolving this error is critical because an unrecognized charset blocks client connections, schema changes, and data insertion that rely on the missing encoding. Production outages and data corruption risks can follow if the issue is ignored.
Unsupported or misspelled character sets in CREATE DATABASE, CREATE TABLE, or SET NAMES statements trigger EE_UNKNOWN_CHARSET immediately.
MySQL validates the charset name against its compiled list and Index.xml.
Misconfigured my.cnf or my.ini files can set character_set_server or collation_server to a non-existent charset. The server fails to start or shows the error during runtime configuration reloads.
Custom MySQL builds compiled without optional charsets (e.g., utf8mb4_0900_ai_ci in older forks) produce the error when applications expect those encodings.
First, confirm the typo or unsupported charset with SHOW CHARACTER SET.
If the charset is absent, switch to a supported one such as utf8mb4.
If the charset should exist, verify that the $MYSQL_HOME/share/charsets/Index.xml
file lists it.
Corrupted or missing files can be restored by reinstalling the MySQL package.
For custom builds, recompile MySQL using -DWITH_EXTRA_CHARSETS=all
or specify the exact charset in CMake to embed it in the binary.
A startup failure due to character_set_server=utf16
in my.cnf is solved by replacing the value with utf8mb4 and restarting the service.
An application that issues SET NAMES latin10
can be fixed by changing the call to SET NAMES latin1
or another supported encoding.
Docker images trimmed for size may omit charset files.
Switching to the full community image or copying missing .xml
and .conf
charset files restores functionality.
Standardize on utf8mb4 for new schemas to leverage full Unicode and avoid obscure charsets.
Add automated integration tests that run SHOW CHARACTER SET LIKE 'utf8mb4'
after container builds, preventing image promotion when charsets are missing.
Use Galaxy collections to store vetted CREATE statements so developers reuse approved character sets instead of ad-hoc names.
Error 1115 unknown character set occurs on client side and is solved with the same charset verification steps.
Error 1267 illegal mix of collations appears when incompatible charsets mix in queries; fix by aligning column collations.
.
No. Charsets must be compiled into the server or listed in Index.xml. Recompilation or reinstalling a build with the charset is required.
Many lightweight images exclude optional charsets to reduce size. Use the full image or copy the missing charset files.
Only if the variable was set to the unsupported charset. Otherwise you must correct the server configuration or schema definition.
Galaxy's AI copilot auto-suggests supported charsets and flags unknown ones during query drafting, lowering the risk of this error in production.