Thursday, December 29, 2016

How to fully support utf8 in MySQL

This is great read on why should use utf8mb4 and not just utf8:

https://mathiasbynens.be/notes/mysql-utf8mb4

This may not be practical for all applications. For example, the other day I was setting up am instance of Zabbix. The tables to create the schema tables did not explicitly state which charset and collation to use so it was accepting the MySQL server defaults which were utf8mb4 . However, this was preventing many of the tables to be created because the primary keys could not be added with utf8mb4 because of key length restrictions. I had to force the tables to use utf8 so that I could create the tables. I felt this was safe because we were not going to be writing utf8mb4 data into the Zabbix motioning tables.

No comments:

Post a Comment