我有点奇怪,为啥typecho都这么多版本了,怎么还不支持emoji.
首先执行下面的SQL语句来修改表的编码
alter table typecho_comments convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_contents convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_fields convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_metas convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_options convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_relationships convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_users convert to character set utf8mb4 collate utf8mb4_unicode_ci;
然后修改typecho的配置文件,位于你的typeocho根目录,文件名:config.inc.php
如下:
$db->addServer(array (
'host' => 'localhost',
'user' => 'typecho_mysql',
'password' => '123654789',
'charset' => 'utf8mb4', //这里原本是utf8,替换成utf8mb4
'port' => '3306',
'database' => 'typecho_mysql',
Done!😁正好来个emoji...