【Linux笔记】第七篇、配置MariaDB的字符集
一、修改配置文件/etc/my.cnf
vi /etc/my.cnf
在[mysqld]标签下添加
#character
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
二、配置文件/etc/my.cnf.d/client.cnf
vi /etc/my.cnf.d/client.cnf
在[client]下添加
#character
default-character-set=utf8
三、配置文件/etc/my.cnf.d/mysql-clients.cnf
vi /etc/my.cnf.d/mysql-clients.cnf
在[mysql]中添加
#character
default-character-set=utf8
四、重启MariaDB服务
service mariadb restart
五、查看字符集
show variables like "%character%";show variables like "%collation%";
设置完毕!