MySQL – Differences Between utf8 and utf8mb4

collationMySQLutf-8

I am converting a few of my tables to utf8mb4 as well as the connection from PHP to MySQL to utf8mb4. This is so that I can support characters used for Emoji in my website.

I have two questions regarding this change:

1) Is it a problem having some tables as "utf8", even though the connection to MySQL now is "utf8mb4"? Can there be collation conflicts?

2) Do "utf8mb4" tables use more disk space, even if there is no utf8mb4 character stored on it?

3) Would you recommend me to change all the tables to utf8mb4?

Thank you!

Best Answer

There should be no space difference for VARCHAR and TEXT fields that contain 1- to 3-byte utf8 characters. CHAR is another matter.

A JOIN between utf8 (in one table) and utf8mb4 (in the other table) may lead to gross inefficiency. At least make sure you are consistent (both CHARACTER SET and COLLATION) on any columns that need to be compared to each other.