Loading... ## 前言 嘿嘿嘿,最近没文章可写啦,只能水水水! ## 正文 首先修改数据库编码啦 ### 1. 修改数据库编码 进入 PhpMyadmin,在博客数据所在数据库的设置(操作 - 排序规则)中,选择 **utf8mb4_unicode_ci** ### 2. 修改数据库表编码 执行以下 sql 语句 ```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 **自行修改为数据库表前缀** ### 3. 修改数据库配置文件 修改网站根目录数据库配置文件 (config.inc.php) 中,大约第五行`'charset' => 'utf8',`中的`utf8` 改为`utf8mb4` ```sql $db->addServer(array ( 'host' => localhost, 'user' => 'youruser', 'password' => 'yourpassword', 'charset' => 'utf8mb4', //修改这一行 'port' => 3306, 'database' => 'yourdatabase' ), Typecho_Db::READ | Typecho_Db::WRITE); ``` 然后就可以装疯啦! Last modification:April 4, 2019 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 0 If you think my article is useful to you, please feel free to appreciate
2 comments
有时候傻傻分不清,你和隔壁的小学长谁是谁,尴尬
尴尬~