MySQL does not show emoji expression or display?? , the reason is not explained here, directly to say the solution. (mainly modified UTF8MB4)
1. Modify the table
2. Modifying fields
ALTER TABLE ' table_name ' MODIFY COLUMN ' column_name ' varchar CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
3. CharSet when modifying client connections
Example: In thinkphp, when you configure a link database parameter, ' db_charset ' = ' utf8mb4 '
Do here, basically already can show emoji expression. If not, then below.
4. Modifying the database environment
SHOW VARIABLES WHERE variable_name like ' character\_set\_% ' OR variable_name like ' collation% ';
+ —————————--- ----+--------------------------+| Variable_name | Value |+-----------------------------+ -------------------- -----+| Character_set_client | UTF8MB4 | | Character_set_connection | UTF8MB4 | | Character_set_database | UTF8MB4 | | Character_set_filesystem | Binary | | Character_set_results | UTF8MB4 | | Character_set_server | utf8mb4 | | Character_set_system | UTF8 | | Collation_connection | Utf8mb4_general_ci | | Collation_database | utf8mb4_general_ci | | Collation_server | utf8mb4_general_ci |+-----------------------------+ ——————---————— + Change example:mysql> set character_set_client=utf8mb4; modify it to look like the table above. If not, please recompile MySQL, but landlord did not try for a long time not to say.
MySQL support emoji workaround