bug #2873

博客乱码

Added by 龙 辉 4 months ago. Updated 4 months ago.

Status:进行中 Start date:12/26/2020
Priority:High Due date:12/30/2020
Assignee:龙 辉 % Done:

0%

Category:- Spent time: -
Target version:-

Description

迁移到新服务器,以往的服务器导出的 sql 也是乱码。

20201226.png (60 kB) 龙 辉, 12/26/2020 16:05

20201226-2.png (70 kB) 龙 辉, 12/26/2020 18:21

History

#1 Updated by 龙 辉 4 months ago

原网站是正常显示的,看能否导出 --default-character-set=utf8 中文正常显示 的.sql 文件 继续折腾。

#2 Updated by 龙 辉 4 months ago

mysql>show variables like 'character%';
----------------------------------------------------+
Variable_name Value
character_set_client utf8
character_set_connection utf8
character_set_database utf8
character_set_filesystem binary
character_set_results utf8
character_set_server utf8
character_set_system utf8
character_sets_dir /usr/share/mysql/charsets/

vim /etc/mysql/my.cnf
[mysqld]
character-set-server=utf8
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8

是否是这个问题,新版MariaDB不使用utf8而使用utf8mb4造成从老版utf8过来的信息乱码?

MariaDB [(none)]> show variables like 'character%';
----------------------------------------------------+
Variable_name Value
character_set_client utf8mb4
character_set_connection utf8mb4
character_set_database utf8mb4
character_set_filesystem binary
character_set_results utf8mb4
character_set_server utf8mb4
character_set_system utf8
character_sets_dir /usr/share/mysql/charsets/

----------------------------------------------------+
8 rows in set (0.00 sec)

vim /etc/mysql/my.cnf
[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’

#3 Updated by 龙 辉 4 months ago

蛮奇怪的错误:ERROR 1184 (08S01) at line 7: Aborted connection 16 to db

1184 08S01 ER_NEW_ABORTING_CONNECTION Aborted connection %ld to db: '%s' user: '%s' host: '%s' (%s)

涉及 MySQL 5.5.60 到 MariaDB 10.1 的数据库迁移。

两边一起折腾
http://blog.huihoo.com
http://newblog.huihoo.com

Also available in: Atom PDF