前言
因为Typecho的字节问题,表情都是超过2字节的默认的2字节存储不了需要将数据库编码改为utf-8mb4
代码
在数据库里面执行以下代码
[alt type="warning"]请备份数据库文件[/alt]
alter table typecho_comments convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table typecho_contents convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table typecho_fields convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table typecho_metas convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table typecho_options convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table typecho_relationships convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table typecho_users convert to character set utf8mb4 collate utf8mb4_general_ci;
网站根目录数据库配置文件config.inc.php,在60行
'charset' => 'utf8mb4', // 将原来的utf8修改为 utf8mb4
表情
😁
评论 (0)