<p>The server cannot recognize the specified locale string in a SET NAMES or SET LC_TIME_NAMES statement.</p>
<p>MySQL Error 1649 ER_UNKNOWN_LOCALE occurs when the server cannot find a locale such as en_US or fr_FR specified in SET commands. Confirm that the locale is compiled into MySQL or provide a valid alternative. Correcting the locale name or rebuilding the server with the desired locale resolves the error.</p>
Unknown locale: '%s'
Error 1649 fires when MySQL receives a locale identifier it does not recognize. The message Unknown locale: '%s' tells you that the server could not locate the requested language-country combination in its compiled locale table.
The problem usually appears during SET NAMES, SET COLLATION_CONNECTION, or SET LC_TIME_NAMES statements that reference non-existent locales. It can also surface during server startup if the collation_server or character_set_server variables contain an unsupported locale tag.
An unsupported locale string such as es_MX_utf8mb4 is the most common cause. Older MySQL builds hard-code a limited locale list, so new regional codes fail.
Mis-typed locale names, missing language packs in custom builds, or stripped locales in container images also generate the error.
First, verify the locale name with SHOW LOCALES or the MySQL manual. Replace invalid values in SET or system variable statements with a supported tag like en_US.
If the locale is valid but absent from the server, rebuild MySQL with the desired locale enabled or upgrade to a distribution that already includes it.
Application frameworks often issue SET NAMES 'utf8mb4' COLLATE 'en_US'. Change the collate clause to utf8mb4_general_ci.
Docker images trimmed for size may omit locale data. Use a full MySQL image or add required locales at build time.
Always test SET statements in staging to confirm locale availability. Pin your MySQL version and document supported locale tags for developers.
When using Galaxy, shared queries are centrally versioned, so invalid locale settings can be caught in code review before they hit production.
Error 1115 Unknown character set arises when the charset portion of a locale is wrong. Use SHOW CHARACTER SET to validate.
Error 1267 Illegal mix of collations appears when two columns with incompatible collations are compared. Align them using ALTER TABLE ... CONVERT TO CHARACTER SET.
The locale string is not compiled into the MySQL build, e.g., en_GB when only en_US exists.
Developers accidentally type de_DEE instead of de_DE, leading to an unknown tag.
Alpine or slim images exclude locale data to reduce size, so standard locales are missing.
Compiling MySQL from source without specifying all locales limits availability at runtime.
Occurs when the specified charset does not exist. Solution: install or select a valid charset.
Triggered when comparing strings of different collations. Solution: align collations or use COLLATE clause.
Raised when an undefined collation is referenced. Solution: choose a supported collation.
Use SHOW VARIABLES LIKE 'lc_%' or consult the MySQL documentation for your exact version.
Official binaries are fixed. To add locales you must install a distribution that already includes them or rebuild from source.
Slim Docker images often strip locale data. Use a full image or add the required packages during build.
Galaxy stores shared queries, so invalid SET statements are reviewed centrally, reducing production incidents.