Rumah > Artikel > pangkalan data > MySQL 数据库保存 Emoji 表情及特殊符号
utf8mb4
:SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
value
字段与上图有出入,请继续阅读本文;ALTER DATABASE database CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
;ALTER TABLE table CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
;ALTER TABLE table CHANGE column column VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
;my.ini
文件,添加或修改如下内容:[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'
Mysql
:service mysqld restart
;再次查看编码字符集,如果与上文图中结果一致,则大功告成~
更多MySQL相关技术文章,请访问MySQL教程栏目进行学习!
Atas ialah kandungan terperinci MySQL 数据库保存 Emoji 表情及特殊符号. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!