Common SQL Errors

MySQL Error 1115: ER_UNKNOWN_CHARACTER_SET - How to Fix and Prevent

Galaxy Team
August 5, 2025

MySQL throws ER_UNKNOWN_CHARACTER_SET (error 1115) when a client or server-side statement references a character set that the server does not recognize or support.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error 1115?

MySQL Error 1115: ER_UNKNOWN_CHARACTER_SET appears when a query, column, or connection requests an unknown character set. Verify the spelling, install missing character sets, or switch to a supported one to resolve the problem quickly.

Error Highlights

Typical Error Message

Unknown character set: '%s'

Error Type

Encoding Error

Language

MySQL

Symbol

ER_UNKNOWN_CHARACTER_SET

Error Code

1115

SQL State

Explanation

Table of Contents

What does "Unknown character set" mean?

Error 1115 is raised when MySQL cannot map the supplied character set name to any character set compiled into the server. The message is returned immediately and the statement stops executing.

The failure can trigger during server startup, client connection negotiation, DDL, or DML that declares an unsupported encoding.

When does Error 1115 occur?

The error surfaces in CREATE DATABASE, CREATE TABLE, ALTER TABLE, SET NAMES, and connection strings that specify an invalid or absent character set plugin.

It is common after migrations from other databases or when restoring dumps generated on servers with custom encodings.

Why should I fix it quickly?

Leaving the error unresolved blocks schema creation, data import, and can break application startups. Fixing it ensures consistent text storage, prevents data corruption, and restores application availability.

What Causes This Error?

Incorrect charset spelling, unavailable character set plugins, mismatched client-server versions, or removed encodings in newer MySQL releases typically trigger Error 1115.

Server misconfiguration, such as commenting out a dynamic plugin directory, can also remove access to character sets added at runtime.

How to Fix MySQL Error 1115

First, confirm the exact character set requested in the error message. Cross check with SHOW CHARACTER SET to see if it exists.

If missing, either install the plugin, recompile MySQL with the charset, or alter the statement to use a supported set like utf8mb4.

Common Scenarios and Solutions

Restoring dumps: Replace unsupported charset declarations in the dump file before import.

Client libraries: Upgrade connectors so that client and server share charset tables.

Best Practices to Avoid This Error

Standardize on utf8mb4 across schemas, validate dumps in CI, and monitor the INFORMATION_SCHEMA.CHARACTER_SETS table for unexpected removals.

Related Errors and Solutions

Error 2019 (HY000): Cannot initialize character set. Occurs when charset exists but tables are corrupt.

Error 1118: Row size too large. Appears when converting to utf8mb4 without adjusting row format.

Common Causes

Misspelled Character Set Name

Typos like utf8mb44 or latin1s appear frequently in manual DDL and migration scripts, leading MySQL to flag the name as unknown.

Removed or Deprecated Charset

Upgrading from MySQL 5.x to 8.0 removes obsolete encodings such as ucs2 if they were not compiled into the new binary.

Dynamic Plugin Not Loaded

Character sets added via dynamic plugins fail when the --plugin-dir path is wrong or the .so file is missing at startup.

Client Charset Mismatch

Old connectors request charsets that the newer server was built without, triggering the error during the handshake.

.

Related Errors

FAQs

How do I know which charsets MySQL supports?

Run SHOW CHARACTER SET or query INFORMATION_SCHEMA.CHARACTER_SETS to list every compiled or dynamically loaded encoding.

Can I add a custom character set?

Yes. Write a character set plugin, place the shared library in the plugin directory, and execute INSTALL PLUGIN.

Will changing to utf8mb4 break existing data?

No data is altered until you ALTER TABLE or column definitions. Test conversions on staging to confirm row sizes.

How does Galaxy help avoid this error?

Galaxy's editor highlights invalid charsets in real time and offers AI fixes, ensuring queries use supported encodings before execution.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo