[[email protected] ~]# uname -a Linux iZ62jhlmsymZ 3.10.0-123.13.2.el7.x86_64 #1 SMP Thu Dec 18 14:09:13 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux [[email protected] ~]# mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 9 Server version: 5.5.41-MariaDB MariaDB Server
修改配置文件
[[email protected] ~]# vi /etc/my.cnf.d/server.cnf
在 [mysqld] 下添加
character-set-server = utf8
character-set-filesystem = utf8
保存退出
[[email protected] ~]# service mariadb restart
在 mysql 中
SHOW VARIABLES LIKE ‘character_set_%‘;
SHOW VARIABLES LIKE ‘collation_%‘;
检查结果是否正确
时间: 2024-10-24 14:55:45