MySQL information_schema更改COLLATIONS IS_DEFAULT

时间:2018-06-12 15:48:32

标签: mysql collation percona mysql-5.7 xtradb

我在为Percona XtraDB设置设置utf8mb4和utf8字符集的默认排序规则时遇到问题。如果我写一个这样的查询:

let _ = n 3 4 [Some 1; Some 2; None; None]

它失败并显示以下消息:

SET @ue = 'test@email.com';

SET @u = (SELECT u.ID FROM db.users u 
WHERE u.user_email = @ue);

这似乎是因为 collat​​ion_connection 会话值始终设置为utf8mb4_general_ci。该变量的全局值为 utf8_unicode_ci ,这仍然不太正确,但更为可取。

我不能为我的生活找到那个会话变量的来源。我已经看了 information_schema.COLLATIONS ,可以看到 utf8_general_ci utf8mb4_general_ci 如下:

/* SQL Error (1267): Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation '=' */

然而我真的不希望这些排序规则成为默认排序?

我已尝试将这些值放在每个节点-------------------------------------------------------- | COLLATION_NAME | CHARACTER_SET_NAME | IS_DEFAULT | -------------------------------------------------------- | utf8_general_ci | utf8 | Yes | -------------------------------------------------------- | utf8mb4_general_ci | utf8mb4 | Yes | -------------------------------------------------------- 文件中,但似乎没有任何影响:

my.cnf

非常感谢任何帮助。

0 个答案:

没有答案