You will need to set the connection encoding to utf8mb4
as well. It depends on how you connect to MySQL how to do this. SET NAMES utf8mb4
is the API-independent SQL query to do so.
What MySQL calls utf8
is a dumbed down subset of actual UTF-8, covering only the BMP (characters 0000
through FFFF
). utf8mb4
is actual UTF-8 which can encode all Unicode code points. If your connection encoding is utf8
, then all data is squeezed though this subset of UTF-8 and you cannot send or receive characters above the BMP to or from MySQL.