mariadb设置utf8mb4
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mariadb设置utf8mb4相关的知识,希望对你有一定的参考价值。
mariaDB的设置方法:
#vim /etc/my.conf
[mysqld]
character_set_server=utf8mb4
collation-server=utf8mb4_unicode_ci
init_connect=
\'SET NAMES utf8mb4\'
skip-character-
set
-client-handshake=
true
#/etc/init.d/mariadb reload
#验证方法,登陆mysql
SHOW VARIABLES WHERE Variable_name LIKE
\'character\\_set\\_%\'
OR Variable_name LIKE
\'collation%\'
;
mysql的设置方法:
#vim /etc/my.conf
[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\'
#/etc/init.d/mariadb reload
#验证方法,登陆mysql
SHOW VARIABLES WHERE Variable_name LIKE
\'character\\_set\\_%\'
OR Variable_name LIKE
\'collation%\'
;
转载:https://www.cnblogs.com/300js/p/9223539.html
以上是关于mariadb设置utf8mb4的主要内容,如果未能解决你的问题,请参考以下文章
UTF8mb4 unicode 破坏 MariaDB JDBC 驱动程序
RHEL7使用国内yum源,安装Mariadb 10.2.25, 并配置字符集为utf8mb4