Mysql 服务器不支持 4 字节编码的 utf8 字符

2021-12-28 00:00:00 utf-8 character mysql utf8mb4 astral-plane

我在运行从 Sql Server 到 MySql db 的数据传输组件时收到服务器错误.错误信息如下:

I've received a server error running a Data transfer component from Sql Server to MySql db. The error message reads as follows:

<代码>[MySql][ODBC 5.1 驱动程序][mysqld-5.0.67-community-nt-log]服务器不支持4字节编码的UTF8字符.

源 Sql Server 表包含 nvarchar 列,目标 MySql 表包含 varchar 列.

The source Sql Server table contains nvarchar columns, the target MySql table contains varchar columns.

有人能解释一下这个问题吗?

Can anybody shed some light on this problem?

推荐答案

如果需要 MySQL 支持 4 字节 UTF-8 字符(通常被认为是 UTF-8 的一部分),则需要使用字符集 utf8mb4,不是utf8.utf8mb4 最早在 MySQL 5.5.3 中得到支持.

If you need MySQL to support 4-byte UTF-8 characters (which is normally considered part of UTF-8), you need to use the character set utf8mb4, not utf8. utf8mb4 was first supported in MySQL 5.5.3.

相关文章