并非所有字符集和排序规则集都更改为utf8mb4(.unicode.ci)

时间:2019-02-21 21:18:00

标签: mysql phpmyadmin mariadb utf8mb4

我试图将字符集设置为utf8mb4,将排序规则集设置为utf8mb4_unicode_ci。在我的网站上,当我使用php / mysql select从表中获取数据时,表情符号看起来不错。仅在phpMyAdmin(4.8.4)中,我将大多数表情符号视为一个问题。

我尝试:

添加到/etc/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

重新启动systemctl restart mariadb

我在自己的网站mysqli_set_charset($con, "utf8mb4");<form accept-charset="UTF-8"><meta charset="utf-8">上使用。

SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%'的结果:

enter image description here

我在做什么错了?

我使用的是MySQL 5.5.60(Mariadb)版本。

编辑: 问题可能出在phpmyadmin(4.8.4)。似乎phpMyAdmin仍在使用utf8。全局variabelen设置为utf8mb4或utf8mb4_unicode_ci,但是我无法更改会话variabelen:

enter image description here

我在config.inc.php中设置: enter image description here

在phpMyAdmin的“普通”表中: enter image description here

当我尝试SET NAMES时,一切看起来都很好: enter image description here

在phpMyAdmin的“常规”设置下,服务器连接归类设置为utf8_unicode_ci。我可以选择utf8mb4_unicode_ci,然后切换回utf8_unicode_ci:(

在我的select网站上,一切正常:

enter image description here

0 个答案:

没有答案