The last 48 hours or so I spend on trying to determine the cause for sporadic crashes of my MySQL (Aurora) DB. Turns out they were attributed to my mixing of database, table, column and stored procedure collation/charsets. My bad, or is it?

Aurora aside, what were the practical reasons for all the ways to configure charset/collation in MySQL? Why couldn't utf8 just become utf8mb4 as part of a major release? Why changing charset or collation of a database/table doesn't actually change the database or table, only future additions to the schema? The last one provides for an opportunity to have a mix of columns charset/collations in your tables, for instance. What sane person would want to have different charsets/collations within the same DB? And if there is a rationale for all this madness, why not make it the exception rather than the norm when configuring mysqld?

In my case, to resolve mysqld crashes I had to ensure all of below return consistent charset/collation values:

show procedure status where db = '<database>';
SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = "<database>";
SELECT T.table_name, CCSA.character_set_name
 FROM information_schema.`TABLES` T,
WHERE CCSA.collation_name = T.table_collation
  AND T.table_schema = "<database>"
SELECT table_name, column_name, character_set_name FROM information_schema.`COLUMNS` WHERE table_schema = "<database>";

Example crash stack trace which appears to be tied to my mixing of charset/collation types:

  mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.

It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1070055 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x2a2a2a50d000
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x2a2a2a50d000 thread_stack 0x40000

1 Answer 1


Version 5.7 made good strides toward settling on utf8mb4; the next version, 8.0, is there.

But, changing anything under the hood is all too likely to cause grief. MySQL learned that lesson when "fixing" the handling of ß in utf8_general_ci collation many years ago. It broke lots of users' tables. So, they came out with the kludge utf8_general_mysql500_ci.

The grief over the 767-byte limit on a column in an index would break blindly changing utf8 to utf8mb4.

I predict that utf8 will live on, but only for compatibility for those upgrading. Meanwhile, a really UTF-8-compliant utf8mb4 will be the default. And there will be a succession of collations such as utf8mb4_unicode_ci, utf8mb4_unicode_520_ci, utf8mb4_0900_ai_ci, and more will keep up with the Unicode standard (4.0, 5.20, 9.0), which keeps changing.

The charset and collation for a database is only the default for subsequently created tables. Ditto for table:column.

To change the charset/collation for an entire table: ALTER TABLE .. CONVERT TO ...

I think I am sane. This makes sense to me:

    name        ... CHARACTER SET utf8mb4,
    postal_code ... CHARACTER SET ascii

It is even a performance issue if you let postal_code with utf8mb4 unnecessarily explode by a factor of 4 during certain operations.

As for why things are crashing in Aurora, I don't see enough info to help with this question. And, since I have not heard of anything similar in MySQL or MariaDB, I suspect is may be an Aurora bug. (Aurora is MySQL plus low level improvements; I have not heard of charset issues, but who knows?)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.