MSSQL到MYSQL迁移:SQL_LATIN1_GENERAL_CPI_CI_AS的归类等效项

时间:2021-04-05 09:36:38

I am migrating my database from MSSQL to Aurora (MYSQL 5.7). I want to know the Collation equivalent for SQL_LATIN1_GENERAL_CPI_CI_AS in MYSQL. The closest I could find using (SHOW COLLATION WHERE Charset = 'latin1';) was 'latin1_general_ci'.

我正在将我的数据库从MSSQL迁移到Aurora(MYSQL 5.7)。我想知道MYSQL中SQL_LATIN1_GENERAL_CPI_CI_AS的Collat​​ion等价物。我能找到的最接近的(SHOW COLLATION WHERE Charset ='latin1';)是'latin1_general_ci'。

1 个解决方案

#1


1  

MySQL does not have any COLLATIONs that are simultaneously "case insensitive" and "accent sensitive".

MySQL没有任何同时“不区分大小写”和“重音敏感”的COLLATION。

If you don't have any "accents" in your data, then the issue is moot. In that case, latin1_general_ci is probably what you want.

如果您的数据中没有任何“重音符号”,则问题没有实际意义。在这种情况下,latin1_general_ci可能就是你想要的。

Here is what I see in the version I am running:

这是我在运行的版本中看到的内容:

mysql> SHOW COLLATION LIKE 'latin1%';
+-------------------+---------+----+---------+----------+---------+
| Collation         | Charset | Id | Default | Compiled | Sortlen |
+-------------------+---------+----+---------+----------+---------+
| latin1_german1_ci | latin1  |  5 |         | Yes      |       1 |
| latin1_swedish_ci | latin1  |  8 | Yes     | Yes      |       1 |
| latin1_danish_ci  | latin1  | 15 |         | Yes      |       1 |
| latin1_german2_ci | latin1  | 31 |         | Yes      |       2 |
| latin1_bin        | latin1  | 47 |         | Yes      |       1 |
| latin1_general_ci | latin1  | 48 |         | Yes      |       1 |
| latin1_general_cs | latin1  | 49 |         | Yes      |       1 |
| latin1_spanish_ci | latin1  | 94 |         | Yes      |       1 |
+-------------------+---------+----+---------+----------+---------+
8 rows in set (0.00 sec)

The non-'general' collations shuffle the accented letters a little due to nation preferences.

由于国家偏好,非“一般”整理将重音字母稍微洗了一​​下。

#1


1  

MySQL does not have any COLLATIONs that are simultaneously "case insensitive" and "accent sensitive".

MySQL没有任何同时“不区分大小写”和“重音敏感”的COLLATION。

If you don't have any "accents" in your data, then the issue is moot. In that case, latin1_general_ci is probably what you want.

如果您的数据中没有任何“重音符号”,则问题没有实际意义。在这种情况下,latin1_general_ci可能就是你想要的。

Here is what I see in the version I am running:

这是我在运行的版本中看到的内容:

mysql> SHOW COLLATION LIKE 'latin1%';
+-------------------+---------+----+---------+----------+---------+
| Collation         | Charset | Id | Default | Compiled | Sortlen |
+-------------------+---------+----+---------+----------+---------+
| latin1_german1_ci | latin1  |  5 |         | Yes      |       1 |
| latin1_swedish_ci | latin1  |  8 | Yes     | Yes      |       1 |
| latin1_danish_ci  | latin1  | 15 |         | Yes      |       1 |
| latin1_german2_ci | latin1  | 31 |         | Yes      |       2 |
| latin1_bin        | latin1  | 47 |         | Yes      |       1 |
| latin1_general_ci | latin1  | 48 |         | Yes      |       1 |
| latin1_general_cs | latin1  | 49 |         | Yes      |       1 |
| latin1_spanish_ci | latin1  | 94 |         | Yes      |       1 |
+-------------------+---------+----+---------+----------+---------+
8 rows in set (0.00 sec)

The non-'general' collations shuffle the accented letters a little due to nation preferences.

由于国家偏好,非“一般”整理将重音字母稍微洗了一​​下。