|
Let MySQL support Emoji expression, it relates to wireless relevant recommendations ahead of the MySQL database using utf8mb4 character set.
MySQL version 5.6
1 Solution: Mysql transcoding from utf8 to utf8mb4.
Require> = MySQL 5.5.3 version, from the library must also be 5.5, the low version does not support this character set, copy error
2 my.cnf file to add
[Mysqld]
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
init_connect = 'SET NAMES utf8mb4'
3 Modify the character set you need to add the database table fields
Modify the database character set:
ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
Modify the character set table:
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Modify the character set field:
ALTER TABLE table_name CHANGE column_name column_name VARCHAR (191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
If you just need a field only need to modify the character set that will be able to field
4 If you modify the query above will not please sql
mysql> show variables like '% sql_mode%';
+ --------------- + --------------------------------- ----------- +
| Variable_name | Value |
+ --------------- + --------------------------------- ----------- +
| Sql_mode | STRICT_TRANS_TABLES, NO_ENGINE_SUBSTITUTION |
+ --------------- + --------------------------------- ----------- +
1 row in set (0.00 sec)
If these results can not congratulate you is stored
Sql_mod to set this mode (see note here after revision to exit the console or else see the effect, and
This configuration write my.cnf and restart the server is not in force, if you want to ask why please go mysql consultant group)
mysql> set global sql_mode = 'NO_ENGINE_SUBSTITUTION';
mysql> show variables like '% sql_mode%';
+ --------------- + ------------------------ +
| Variable_name | Value |
+ --------------- + ------------------------ +
| Sql_mode | NO_ENGINE_SUBSTITUTION |
+ --------------- + ------------------------ +
1 row in set (0.00 sec)
6 Once this is done is complete, let MySQL support Emoji expression. |
|
|
|