Calculates on this device. File exports run online.
Database Collation Checker
Paste the CREATE TABLE statements of a MySQL or MariaDB database and see the character set and collation of every text column, worked out by MySQL’s own rules, with the mixes that cause “Illegal mix of collations”, foreign keys MySQL refuses and utf8mb3 columns. You can also look up what a collation name means, or find the values that a case- or accent-insensitive collation would treat as one.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose the button below them.
Your result
How it was worked out
How to use it
- Run SHOW CREATE TABLE for your tables, or mysqldump --no-data, and paste the statements. Add the CREATE DATABASE statement, or type the server default collation, so tables without their own collation can be worked out.
- Press Check the statements and read the findings, then the table of every text column with its collation and where it comes from.
- Choose What a collation name means to read a name such as utf8mb4_0900_ai_ci or Latin1_General_100_CI_AS_SC.
- Choose Values a collation counts as equal and paste the values of a column before you add a UNIQUE index or change its collation. For millions of rows, use the box below with a CSV export.
How the collation of a column is found
- A column with CHARACTER SET and COLLATE uses those; with only CHARACTER SET, the default collation of that set; with only COLLATE, the set of that collation; with neither, the table’s. A table gets its defaults from the database the same way (MySQL 8.4 Reference Manual, 12.3).
- Default collations and bytes per character are those of MySQL 8.4 (utf8mb4: utf8mb4_0900_ai_ci). MariaDB and older MySQL versions use other defaults for some sets; when in doubt, read the collation that SHOW CREATE TABLE prints.
- String columns of a foreign key need the same character set and collation as the columns they reference (MySQL 8.4 Reference Manual, 15.1.20.5).
- PAD SPACE collations ignore spaces at the end of a value when they compare; NO PAD collations (UCA 9.0.0 and later, such as utf8mb4_0900_ai_ci) count them.
What this check does not do
- It reads the statements you paste; it does not connect to your database. Collations set by ALTER TABLE or at connection time are not seen.
- Equal values are an estimate made with Unicode normalization and case mapping. MySQL’s collation tables decide in the end: test the values that matter in your own database.