MySQL 支援儲存emoji表情

2021-10-25 02:24:37 字數 886 閱讀 4176

create table `tp_user_integral` (

`id` bigint(20) unsigned not null auto_increment,

`uid` bigint(20) unsigned not null default '0' comment '使用者id',

`first_name` varchar(255) default null,

primary key (`id`)

) engine=innodb auto_increment=3 default charset=utf8 comment='使用者積分基礎表(積分**)';

複製紅色區域的emoji 然後進行插入 就會出現這個問題

並非必然 只是有些emoji不能支援  我使用第一排的那個表情時就是能正常插入的

alter table tp_user_integral modify `first_name` varchar(255) character set utf8mb4 collate utf8mb4_unicode_ci;
執行這個語句之後再進行插入就可以正常插入了

Mysql支援emoji表情儲存

正常使用uft 8方式儲存是不能儲存emoji表情文字的,主要原因是uft8位元組不夠,導致儲存不了,需要更改為uft8mb4,下面說說具體操作步驟 1 需要你的mysql資料庫版本在5.5以上 2 更改你的資料庫,表,以及需要儲存emoji列的編碼方式 對每乙個資料庫 alter database...

MySql支援Emoji表情儲存

utf8mb4和utf8的區別如下 utf8乙個字元最多3位元組,而utf8mb4則擴充套件到乙個字元最多能有4位元組,所以能支援更多的字符集。mysql 需要支援 emoji 表情符號版本需要大於5.5.3,且字符集需要設定為utf8mb4 字符集。1 設定資料表結構字符集 alter table...

Mysql 支援 Emoji 表情儲存

坑 在工具查不一定能檢視到emoji,是因為工具的編碼不一定是utf8mb4 1 登入到阿里雲 rds 管理控制台,管理例項,找到設定引數選單,找到引數 character set server,預設值為 utf8 修改為 utf8mb4,提交引數 注意 提交引數需要重啟rds例項 2 設定資料庫 ...