For historical reasons, the UTF8 character set provided by MySQL in previous versions of 5.5.3 is not really utf8, it is just a subset of UTF8 and provides limited UTF8 support. Starting with mysql5.5.3, MySQL changed the internal details implementation, added a UTF8MB4 character set, supported True Unicode, and extended the length from the previous maximum of 3 bits to 4 bits, such as emoticons such as emoji can finally be stored in MySQL.
Whether MySQL provides an older version of the UTF8 character set or utf8mb4,php is handled correctly.
If your MySQL version supports UTF8MB4, it's a good idea to add the following settings in MY.CNF:
[Client]
Default-character-set = Utf8mb4
[MySQL]
Default-character-set = Utf8mb4
[Mysqld]
Character-set-client-handshake = FALSE
Character-set-server = Utf8mb4
Collation-server = Utf8mb4_unicode_ci
init_connect= ' SET NAMES utf8mb4 '
In MySQL, variable name separators are used-or _ are correct, preferably unified.
Other places refer here.
MySQL Character set selection utf8mb4