【MySQL】Mariadb字符集
Mariadb字符集
如果不设置字符集,可以查看mariadb的字符集的默认设置是latin1
。
如下命令,查看Mariadb的默认配置:
[ ~]# /usr/local/mysql/bin/mysqld --verbose --help |grep character-set-server 2019-09-23 16:10:05 0 [Note] Plugin 'FEEDBACK' is disabled. -C, --character-set-server=name character-set-server latin1
修改Mariadb的字符集为utf8
,国际统一标准,配置如下:
[ ~]# vi /etc/my.cnf [mysqld] datadir=/u01/data/ socket=/tmp/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 character-set-server = utf8 [mysqld_safe] log-error=/u01/data/mysqld.log pid-file=/tmp/mysqld.pid
重启服务,如下:
[ ~]# service mysqld restart
最终,服务器统一为utf8
,如下:
[ ~]# mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 9 Server version: 10.3.18-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> show variables like '%character%'; +--------------------------+----------------------------------+ | Variable_name | Value | +--------------------------+----------------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/local/mysql/share/charsets/ | +--------------------------+----------------------------------+ 8 rows in set (0.001 sec)
相关推荐
Gexrior 2020-10-22
Lostinthewoods 2020-10-29
txt 2020-06-14
azhou 2020-06-12
hungzz 2020-06-11
CharlesYooSky 2020-06-05
aliuge 2020-06-03
URML 2020-05-30
lwwishes 2020-05-29
83173052 2020-05-29
tanyhuan 2020-05-28
muzirigel 2020-05-26
饮马天涯 2020-05-20
aliuge 2020-05-12
83173052 2020-05-10
Mrbianxin 2020-05-07
InJavaWeTrust 2020-05-04